DEV: Move the failures list to the end of output (#11082)

DEV: Move the failures list to the end of output (#11082)

No more scrolling up each time the tests fail.

(Alternatively, we could just not show the slowest tests list when there are any failures :man_shrugging:)

diff --git a/test/run-qunit.js b/test/run-qunit.js
index 01a0c1a..018b14b 100644
--- a/test/run-qunit.js
+++ b/test/run-qunit.js
@@ -234,15 +234,6 @@ function logQUnit() {
   QUnit.done(function (context) {
     console.log("\n");
 
-    if (testErrors.length) {
-      console.log("Test Errors");
-      console.log("----------------------------------------------");
-      testErrors.forEach((e) => {
-        console.error(e);
-      });
-      console.log("\n");
-    }
-
     console.log("Slowest tests");
     console.log("----------------------------------------------");
     let ary = Object.keys(durations).map((key) => ({
@@ -254,6 +245,17 @@ function logQUnit() {
       console.log(pair.key + ": " + pair.value + "ms");
     });
 
+    console.log("\n");
+
+    if (testErrors.length) {
+      console.log("Test Errors");
+      console.log("----------------------------------------------");
+      testErrors.forEach((e) => {
+        console.error(e);
+      });
+      console.log("\n");
+    }
+
     var stats = [
       "Time: " + context.runtime + "ms",
       "Total: " + context.total,

GitHub sha: ac5c457d

This commit appears in #11082 which was approved by pmusaraj. It was merged by CvX.