Bug 1242985 - Fix jetpack-package-harness to not mark as skipped test suites which fail to load. r?mossop draft
authorLuca Greco <lgreco@mozilla.com>
Tue, 26 Jan 2016 16:41:51 +0100 (2016-01-26)
changeset 325817 caf1c92d36d7d6b56534ee594955fbd060c21058
parent 325499 0fa26d9b2b8f947356bd746cf5dc4c42785a06a2
child 513514 ebc5796c7fcd9922aad61e1b5a2eba7aa83a0c76
push id10055
push userluca.greco@alcacoop.it
push dateTue, 26 Jan 2016 15:50:31 +0000 (2016-01-26)
reviewersmossop
bugs1242985
milestone46.0a1
Bug 1242985 - Fix jetpack-package-harness to not mark as skipped test suites which fail to load. r?mossop
testing/mochitest/jetpack-package-harness.js
--- a/testing/mochitest/jetpack-package-harness.js
+++ b/testing/mochitest/jetpack-package-harness.js
@@ -49,19 +49,25 @@ function testModule(require, { url, expe
       let suiteModule;
       try {
         dump("TEST-INFO: " + path + " | Loading test module\n");
         suiteModule = loaderModule.main(loader, "tests/" + path.substring(0, path.length - 3));
       }
       catch (e) {
         // If `Unsupported Application` error thrown during test,
         // skip the test suite
-        suiteModule = {
-          'test suite skipped': assert => assert.pass(e.message)
-        };
+        if (/Unsupported Application/.test(e.message)) {
+          suiteModule = {
+            'test suite skipped': assert => assert.pass(e.message)
+          };
+        } else {
+          suiteModule = {
+            'test suite failed to load': assert => assert.fail(`${e.message}: ${e.stack}`)
+          };
+        }
       }
 
       for (let name of Object.keys(suiteModule).sort()) {
         if (NOT_TESTS.indexOf(name) != -1)
           continue;
 
         tests.push({
           setup: suiteModule.setup,