次のコードブロックがあります。
(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(); };
}
結果が異なる複数の URL に対してこれを実行しようとしていますが、異なるパラメーターで asyncTest を 2 回実行する方法がわかりません。関数 (asyncTest の 2 番目のパラメーター) を変数に割り当てて asyncTest() に挿入しようとしましたが、これは機能しません。複数の「asyncTest」を定義して実行するにはどうすればよいですか?