How to run the tests in browser, without nodejs to verify ?
Note, have not yet achieved running tests in browser without nodejs. @JaredSmith 's assistance was essential to running tests at all using nodejs.
已經能夠實現利用和Unofficial mirror of the WebKit SVN repository -> master -> LayoutTests -> js -> promises-tests調整文件的問題說明的要求。
試圖儘可能地改變。更新promises-tests
版本到2.1.1
從2.0.5
出現在webkit
回購;包括.js
來自其他回購部分的文件到resources
目錄;在adapter.js
內添加jQuery-3.0.0-pre
源;評論promises-in-workers.html
哪些測試Promise
在Worker
環境jQuery()
初始化檢查document
功能。
通過下載jquery-3.0.0-promises-tests-in-browser運行測試,在瀏覽器中打開index.html
。
$(document).ready(function() {
$("title, h3")
.html("jQuery version " + jQuery().jquery + " Promises/A+ Compliance Tests");
var tests = ["promises-tests-2-1-2.html"
, "promises-tests-2-1-3.html"
, "promises-tests-2-2-1.html"
, "promises-tests-2-2-2.html"
, "promises-tests-2-2-3.html"
, "promises-tests-2-2-4.html"
, "promises-tests-2-2-5.html"
, "promises-tests-2-2-6.html"
, "promises-tests-2-2-7.html"
, "promises-tests-2-3-1.html"
, "promises-tests-2-3-2.html"
, "promises-tests-2-3-3.html"
, "promises-tests-2-3-4.html"
, "Promise-types.html"
// TODO test `jQuery.Deferred()` in `Worker`
// see http://stackoverflow.com/q/10491448/
/* , "promises-in-workers.html" */ ];
$.each(tests, function(index, test) {
$("<iframe>", {
width: "100%"
}).on("load", function(e) {
setTimeout(function() {
e.target.height = e.target.contentWindow
.document.body.scrollHeight * 1.1 + "px";
}, 2000 * (1 + index));
// if (index === tests.length - 1) {
// $(e.target.contentWindow.document.body)
// .prepend("<span style='font-family:Times New Roman'>"
// + "Promises in Workers Test</span>")
// }
})
.attr("src", test).appendTo("body")
})
});
Demonstration
請詢問僅爲後一個問題。 – Bergi
您可以輕鬆地將jQuery的延遲實現放入nodejs模塊並在那裏測試,它不應該有所作爲。 – Bergi
@Bergi對'nodejs'或'nodejs'模塊幾乎沒有經驗。 _「如果你在瀏覽器中設置正確。」_因此目前的查詢。更新OP到單個問題 – guest271314