Thanks! It works! But I still can't wrap my head around an asynchronous test. How does the code actually run? The QUnit manual doesn't give much information on "stop" and "start" functions, it just gives an example about how to use them. Is there a thorough explanation or tutorial to introduce how it actually works? Thanks.
BTW, the "module" functions seems not working in the latest version (October 12, 2009) on github, it doesn't prepend module name to every test. On Oct 23, 8:52 am, Steven Parkes <smpar...@smparkes.net> wrote: > Tests don't nest in any particularly meaningful way. When you execute > test(), you add an entry to the queue of tasks to be processed. So > your nested test is just adding a new test at the end of the queue, > independent of the current test. > > Do you want something as simple as (untested, so to speak): > > test('asyncTest', function() { > stop(); > expect(2); > setTimeout(function() { > ok(true, 'success'); > $.ajax({ > url: './index.html', > success: function() { > ok(true, 'ajax success'); > start(); > } > }); > }, 100); > > }); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---