FIX: Only raise proper `"error"` messages

FIX: Only raise proper "error" messages

Also support “1” for QUNIT_FAIL_FAST to make it consistent with other arguments.

diff --git a/app/assets/javascripts/discourse/app/lib/ajax.js b/app/assets/javascripts/discourse/app/lib/ajax.js
index 45059a6..c08a29d 100644
--- a/app/assets/javascripts/discourse/app/lib/ajax.js
+++ b/app/assets/javascripts/discourse/app/lib/ajax.js
@@ -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;
diff --git a/test/run-qunit.js b/test/run-qunit.js
index 14e9046..90a9eb2 100644
--- a/test/run-qunit.js
+++ b/test/run-qunit.js
@@ -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"
       );

GitHub sha: 09254410