 |
 User: Login | Is a collection of industrial-grade JavaScript utilities and widgets that enable you to efficiently get the most out of today’s powerful web applications. News and Articles about Designing and Developing with Yahoo! Libraries. |
| Address URL | http://www.yuiblog.com/blog Registered: 26-Apr-2008 |
| Ads: |
|
Send to email | Announcing YUI Test 1.0.0 Beta 2 in Development | By Nicholas C. Zakas el 13-Apr-2011 | Late last year we released the beta 1 version of YUI Test. Since that time, we’ve been gathering feedback, fixing bugs, and implementing new features. Today I’m happy to announce the availability of YUI Test 1.0.0 beta 2, the last planned beta release before GA. This release features some new core functionality as well as initial support for Node.js. All of this is designed to make YUI Test a more complete testing solution no matter where you write JavaScript.
Core Changes
Based on feedback from the YUI community, there have been some important additions to the YUI Test core. The first such change is the introduction of init() and destroy() on TestCase objects. Prior to this release, you could use setUp() and tearDown() to initialize and cleanup data needed to run tests. In the traditional xUnit style, setUp() ran before every test and tearDown() ran after every test. The init() and destroy() methods each run only once per TestCase object: init() runs first, before the first call to setUp(), and destroy() runs last, after the last call to tearDown(). These methods are useful for setting up data that the entire TestCase needs. For example:
var testCase = new YUITest.TestCase({
name: "TestCase Name",
//---------------------------------------------
// init and destroy
//---------------------------------------------
init : function () {
this.data = { name : "Nicholas", age : 28 };
},
destroy : function () {
delete this.data;
},
//---------------------------------------------
// Tests
//---------------------------------------------
testName: function () {
YUITest.Assert.areEqual("Nicholas", this.data.name, "Name should be 'Nicholas'");
},
testAge: function () {
YUITest.Assert.areEqual(28, this.data.age, "Age should be 28");
}
});
Another change is the introduction of a feature called context data. When the TestRunner begins, it creates an object that is passed into every init(), setUp(), destroy(), tearDown(), and test method. The object is empty by default and you can use it to easily share data amongst methods and TestCase objects. For example:
var testSuite = new YUITest.TestSuite({
name: "Test Suite Name",
setUp: function(data){
data.topLevel = 1;
}
});
testSuite.add(new YUITest.TestCase({
name: "First Test Case",
init: function(data){
data.foo = "bar";
},
testValueOfFoo : function (data) {
YUITest.Assert.areEqual("bar", data.foo); //from init
},
testValueOfTopLevel: function(data){
YUITest.Assert.areEqual(1, data.topLevel); //from test suite
}
});
testSuite.add(new YUITest.TestCase({
name: "Second Test Case",
testValueOfFoo : function (data) {
YUITest.Assert.areEqual("bar", data.foo); //from init in First Test Case
},
testValueOfTopLevel: function(data){
YUITest.Assert.areEqual(1, data.topLevel); //from test suite
}
});
How you use context data is completely up to you. You can choose to ignore it completely and all of your tests will continue to work just fine.
YUI Test for Node.js
Continuing with our goal of making YUI Test a ubiquitous fixture for JavaScript unit testing, beta 2 introduces YUI Test for Node.js. You can install YUI Test for Node.js via npm using the following command:
npm install yuitest
Once installed, you can pass in files and directories containing JavaScript tests to run. Example:
yuitest testfile.js path/to/tests
The only difference between writing tests for the browser and writing tests for Node.js is that you must include YUI Test in the JavaScript file. The following format works well if you’d like to create a JavaScript test file that can be run both in the browser and using Node.js,
(function(){
//define local version of YUITest based on what's available.
var YUITest = this.YUITest || require("yuitest");
var testCase = new YUITest.TestCase({
//test case details
});
YUITest.TestRunner.add(testCase);
})();
Keep in mind that Node.js is not a browser environment and as such tests that rely on browser features such as the DOM will likely throw errors.
Moving Towards GA
There’s still a lot of work to be done before YUI Test 1.0.0 reaches GA, and you can help! Download beta 2 today and start filing bugs for the issues you find. Fork the code on GitHub and submit patches. For the GA release we’ll be looking at more bug fixes, better documentation, and anything else that the community feels is important for the release.
Read 23 times

|
|
 |
 |
 | Yahoo User Interface Blog | Blogger | Is a collection of industrial-grade JavaScript utilities and widgets that enable you to efficiently get the most out of today’s powerful web applications. Yahoo! User Interface Blog News and Articles about Designing and Developing wiht Yahoo! Libraries. |
| Announcing YUI Test 1.0.0 Beta 2 | | Late last year we released the beta 1 version of YUI Test. Since that time, we’ve been gathering feedback, fixing bugs, and implementing new features. Today I’m happy to announce the availability of YUI Test 1.0.0 beta 2, the last planned beta release before GA. This release features some new core functionality as well as [...] [..] Read complete article |  | Published 13-Apr-2011 by Nicholas C. Zakas in Development Read 23 times. More hits in  |
|
 | Joystiq | Blogger | Covers video game news from an independent, unbiased perspective Joystiq Joystiq |
 | Joystiq | Blogger | Covers video game news from an independent, unbiased perspective Joystiq Joystiq |
| Blizzard opens beta test opt-in for Starcraft II |
We don't have to tell you how big a deal Starcraft II is. In the next few months, Blizzard will be ironing out the kinks through a beta test period for the RTS sequel, and right now you can try to get in on that action. [..] Read complete article |  | Published 06-May-2009 by David Hinkle in blizzardpcrtsstarcraft-2starcraft-ii Read 21 times. More hits in  |
|
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
 | Joystiq | Blogger | Covers video game news from an independent, unbiased perspective Joystiq Joystiq |
| Patapon-related beta test teased | As tends to happen around this time of year, another countdown site has popped up, this one on the Japanese PlayStation site. It's counting down to the start of a beta test for ... something, with the countdown against a black background, with som [..] Read complete article |  | Published 11-Jun-2010 by JC Fletcher in CountdownJapanPataponplaystationpsp Read 19 times. More hits in  |
|
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
| Blizzard Patches Diablo II, Beta Test It Now [Blizzard] | | Say what you want about Blizzard's ability to get Diablo III out the door in a timely fashion. But you can't knock the developer for its support of older games, especially in light of Diablo II's new patch. Version 1.13 of Blizzard's nine-year-old action-RPG is now yours [..] Read complete article |  | Published 10-Dec-2009 by Michael McWhertor in Blizzard BetaDiablo IIPC Read 19 times. More hits in ![Images about Blizzard Patches Diablo II, Beta Test It Now [Blizzard]](./images/photo.gif) |
|
 | Joystiq | Blogger | Covers video game news from an independent, unbiased perspective Joystiq Joystiq |
| Beta test Skyrim 1.4 on Steam (if you dare) | Last week, Bethesda gave us the patch notes for Skyrim's next update, version 1.4. Rather than longingly glare at a web page for all of the fixes coming to your plagued save files, you have another option, granted you' [..] Read complete article |  | Published 23-Jan-2012 by David Hinkle in bethesdaelder-scrolls-5patchpatch-1.4pcskyrimsteamthe-elder-scrolls-v-skyrimupdatevalve Read 5 times. More hits in  |
|
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
 | Joystiq | Blogger | Covers video game news from an independent, unbiased perspective Joystiq Joystiq |
| Hybrid beta test begins on XBLA 'shortly after GDC' | | 5th Cell's XBLA shooter Hybrid is ready for a semi-public debut. The developer announced an XBLA beta test this morning, with signups taking place "shortly after GDC" (which runs next week, March 5-9).This may not be as welcome as news of [..] Read complete article |  | Published 01-Mar-2012 by JC Fletcher in 5th-cellbetahybridhybrid-xblamicrosoftxblaxbox Read 0 times. More hits in  |
|
|
Warning We are not responsible of information posted from external feeds. Use this website at your own risk.
Notice: We will not be liable for any direct or indirect loss or damage arising under this disclaimer or in connection with our website, whether arising in tort, contract, or otherwise.
|
|
| |