Quit tests early, output seed to easily reproduce failure

Quit tests early, output seed to easily reproduce failure

diff --git a/test/run-qunit.js b/test/run-qunit.js
index 905745b..42e4ff1 100644
--- a/test/run-qunit.js
+++ b/test/run-qunit.js
@@ -194,6 +194,7 @@ function logQUnit() {
       testErrors.push(msg);
       assertionErrors = [];
       console.log("F");
+      QUnit.config.queue.length = 0;
     } else {
       console.log(".");
     }
@@ -245,6 +246,17 @@ function logQUnit() {
     ];
     console.log(stats.join(", "));
 
+    if (context.failed) {
+      console.log("\nUse this filter to run in the same order:");
+      console.log("QUNIT_SEED=" + QUnit.config.seed + " rake qunit:test\n");
+      console.log("If you have a web environment running, you can visit:");
+      console.log(
+        "http://localhost:3000/qunit?hidepassed&seed=" +
+          QUnit.config.seed +
+          "\n\n"
+      );
+    }
+
     window.qunitDone = context;
   });
 }

GitHub sha: 18e33395

2 Likes