FIX: Only raise proper "error" messages

Also support "1" for `QUNIT_FAIL_FAST` to make it consistent with other
arguments.
This commit is contained in:
Robin Ward 2020-08-05 16:27:06 -04:00
parent f1b6b1bd0e
commit 09254410ea
2 changed files with 4 additions and 3 deletions

View File

@ -121,7 +121,7 @@ export function ajax() {
// 0 represents the `UNSENT` state
if (xhr.readyState === 0) {
// Make sure we log pretender errors in test mode
if (isTesting()) {
if (textStatus === "error" && isTesting()) {
throw errorThrown;
}
return;

View File

@ -109,10 +109,11 @@ async function runAllTests() {
Page.navigate({ url: args[0] });
Page.loadEventFired(async () => {
let qff = process.env.QUNIT_FAIL_FAST;
await Runtime.evaluate({
expression:
`const QUNIT_FAIL_FAST = ` +
(process.env.QUNIT_FAIL_FAST === "true").toString() +
(qff === "1" || qff === "true").toString() +
";"
});
await Runtime.evaluate({
@ -262,7 +263,7 @@ function logQUnit() {
if (context.failed) {
console.log("\nUse this filter to run in the same order:");
console.log(
"QUNIT_FAIL_FAST=true QUNIT_SEED=" +
"QUNIT_FAIL_FAST=1 QUNIT_SEED=" +
QUnit.config.seed +
" rake qunit:test\n"
);