Refactored test suite to allow async tests (use stop() before starting an async request, use start() when finished), added test for bug #164

This commit is contained in:
Jörn Zaefferer 2006-09-19 09:49:22 +00:00
parent 4dcbfc92c3
commit b0c3711d3e
6 changed files with 190 additions and 127 deletions

View file

@ -215,6 +215,19 @@ jQuery.extend({
* }
* )
*
* @test stop();
* $.get("data/dashboard.xml", function(xml) {
* var content = [];
* $('tab', xml).each(function(k) {
* // workaround for IE needed here, $(this).text() throws an error
* // content[k] = $.trim(this.firstChild.data) || $(this).text();
* content[k] = $(this).text();
* });
* ok( content[0].match(/blabla/), 'Check first tab' );
* ok( content[1].match(/blublu/), 'Check second tab' );
* start();
* });
*
* @name $.get
* @type jQuery
* @param String url The URL of the page to load.