A platform for community discussion. Free, open, simple.
FIX: Only raise proper `"error"` messages
Robin Ward09254410eabc
diff --git a/app/assets/javascripts/discourse/app/lib/ajax.js b/app/assets/javascripts/discourse/app/lib/ajax.jsindex 45059a60750..c08a29d87ba 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` stateif (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.jsindex 14e9046de44..90a9eb2cd34 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");