![](/img/trans.png)
[英]Callback for when QUnit has finished running all tests. (`QUnit.done()` not working as expected)
[英]jquery catching QUnit.done
如何從jquery.testHelper.js中捕獲QUnit.done https://github.com/jquery/jquery-mobile/blob/master/tests/jquery.testHelper.js
我試圖定義
QUnit.done = function ( failed, passed, total, runtime ) {
alert("test");
}
但這給了我“ Uncaught ReferenceError:未定義QUnit”
加載QUnit庫后,必須確保定義此定義。 另外,該函數采用一個參數,該參數是一個對象{ name, failed, passed, total }
因此:
QUnit.done = function ( result ) {
alert(result.total);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.