<div id="testLogger"></div>
<script>
YUI().use('node', 'test-console', 'test',function (Y) {
//name of the test case - if not provided, one is auto-generated
name : "Asynchronous Tests",
//---------------------------------------------------------------------
// setUp and tearDown methods - optional
//---------------------------------------------------------------------
/*
* Sets up data that is needed by each test.
*/
setUp : function () {
this.data = {
name: "test",
year: 2007,
beta: true
};
},
/*
* Cleans up everything that was created by setUp().
*/
tearDown : function () {
delete this.data;
},
//---------------------------------------------------------------------
// Test methods - names must begin with "test"
//---------------------------------------------------------------------
testWait : function (){
var Assert = Y.Assert;
//do some assertions now
//wait five seconds and do some more
this.wait(function(){
}, 5000);
}
});
//create the console
(new Y.Test.Console({
newestOnTop : false,
filters: {
pass: true,
fail: true
}
})).render('#testLogger');
//run the tests
});
</script>