????doh??????????????
????1??Simple Tests  ?????????????????doh.register????testCase??????
????????????
????function mySimpleTest(doh){
????doh.assertTrue(true);
????}
???????????

 

function mySimpleAsyncTest(doh){
var deferred = new doh.Deferred();
setTimeout(deferred.getTestCallback(function(){
doh.assertTrue(true);
})?? 100);
return deferred;
}

????2??Test Fixture
????????????

 

{
name: "thingerTest"??
setUp: function(){
// Setup to do before runTest.//??????JUnit?е?@beforeTest
this.thingerToTest = new Thinger();
this.thingerToTest.doStuffToInit();
}??
runTest: function(){
// Our test function to run.//??????JUnit?е?@Test
doh.assertEqual("blah"?? this.thingerToTest.blahProp);
doh.assertFalse(this.thingerToTest.falseProp);
// ...
}??
tearDown: function(){
// cleanup to do after runTest.//??????JUnit?е?@afterTest
}??
timeout: 3000 // 3 second timeout.//???????????????????????
}

???????????

 

{
name: "thingerTest"??
setUp: function(){
// Setup to do before runTest.
this.thingerToTest = new Thinger();
this.thingerToTest.doStuffToInit();
}??
runTest: function(){
// Our test function to run.
var deferred = new doh.Deferred();
setTimeout(deferred.getTestCallback(function(){
doh.assertEqual("blah"?? this.thingerToTest.blahProp);
doh.assertFalse(this.thingerToTest.falseProp);
})?? 100);
return deferred;
}??
tearDown: function(){
// cleanup to do after runTest.
}??
timeout: 3000 // 3 second timeout.
}