mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
qunit runner in autospec has been a mess, opening moves to get it working
This commit is contained in:
@ -32,7 +32,9 @@ page.onConsoleMessage = function (message) {
|
||||
|
||||
page.onCallback = function (message) {
|
||||
// write to the result file
|
||||
if (message.slice(0, 5) === "FILE:") { fs.write(QUNIT_RESULT, message.slice(6), "a"); }
|
||||
if (message.slice(0, 5) === "FAIL:") {
|
||||
fs.write(QUNIT_RESULT, message.slice(6) + "\n", "a");
|
||||
}
|
||||
// forward the message to the standard output
|
||||
if (message.slice(0, 6) === "PRINT:") { system.stdout.write(message.slice(7)); }
|
||||
};
|
||||
@ -131,12 +133,7 @@ function logQUnit() {
|
||||
if (!errors[module][test]) { errors[module][test] = []; }
|
||||
errors[module][test].push(assertion);
|
||||
|
||||
var fileName = context.source
|
||||
.replace(/[^\S\n]+at[^\S\n]+/g, "")
|
||||
.split("\n")[1]
|
||||
.replace(/\?.+$/, "")
|
||||
.replace(/^.+\/assets\//, "test/javascripts/");
|
||||
window.callPhantom("FILE: " + fileName + " ");
|
||||
window.callPhantom("FAIL: " + context.module + ":::" + context.testId + ":::" + context.name);
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user