我有以下代码块:
(function() {
QUnit.config.testTimeout = 10000;
var stringformat = QUnit.stringformat;
module('Web API GET Result has expected shape');
asyncTest('HomeData should return an array of Sets with their info as well as cards with their info, but no sides',
function () {
$.ajax({
url: '/sample/url',
dataType: 'json',
success: function (result) {
ok(
!!result.item, 'Got something');
start();
},
error: function(result) {
ok(false, 'Failed with: ' + result.responseText);
start();
}
}
);
}
);
return function () { asyncTest(); };
}
我尝试针对具有不同结果的多个网址运行此操作,但我无法弄清楚如何使用不同的参数运行asyncTest两次。我尝试将函数(asyncTest的第二个参数)分配给变量并将其插入asyncTest()但是这不起作用。如何定义多个" asyncTest"并运行它们?