From 9c21d7016b84032942365da51b3a90ed80b0a828 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 8 Mar 2026 12:40:06 +0100 Subject: [PATCH 1/3] Check for passed tests first in `test/integration/jasmine-boot.js` This makes the order of checks consistent with the one in `test/reporter.js` and improves safety because now any status other than passed will be treated as a failure (also if Jasmine adds more statuses later on). --- test/integration/jasmine-boot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/jasmine-boot.js b/test/integration/jasmine-boot.js index 8379cea4a..fd4bb5c4f 100644 --- a/test/integration/jasmine-boot.js +++ b/test/integration/jasmine-boot.js @@ -57,11 +57,11 @@ async function runTests(results) { return; } ++results.runs; - if (result.failedExpectations.length > 0) { + if (result.failedExpectations.length === 0) { + console.log(`TEST-PASSED | ${result.description}`); + } else { ++results.failures; console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`); - } else { - console.log(`TEST-PASSED | ${result.description}`); } }, specStarted(result) {}, From 8a5f6f5157afda83eed97cf8f71d8eb0fa6de84d Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 8 Mar 2026 12:41:13 +0100 Subject: [PATCH 2/3] Use the status property of Jasmine's result object in the custom reporters This improves readability of the code and makes it consistent with the recently added check for excluded tests. --- test/integration/jasmine-boot.js | 4 ++-- test/reporter.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/jasmine-boot.js b/test/integration/jasmine-boot.js index fd4bb5c4f..05e87cb4d 100644 --- a/test/integration/jasmine-boot.js +++ b/test/integration/jasmine-boot.js @@ -57,7 +57,7 @@ async function runTests(results) { return; } ++results.runs; - if (result.failedExpectations.length === 0) { + if (result.status === "passed") { console.log(`TEST-PASSED | ${result.description}`); } else { ++results.failures; @@ -70,7 +70,7 @@ async function runTests(results) { return; } // Report on the result of `afterAll` invocations. - if (result.failedExpectations.length > 0) { + if (result.status === "failed") { ++results.failures; console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`); } diff --git a/test/reporter.js b/test/reporter.js index d3475035b..5e19b9097 100644 --- a/test/reporter.js +++ b/test/reporter.js @@ -66,7 +66,7 @@ const TestReporter = function (browser) { return; } // Report on the result of individual tests. - if (result.failedExpectations.length === 0) { + if (result.status === "passed") { sendResult("TEST-PASSED", result.description); } else { let failedMessages = ""; @@ -82,7 +82,7 @@ const TestReporter = function (browser) { return; } // Report on the result of `afterAll` invocations. - if (result.failedExpectations.length > 0) { + if (result.status === "failed") { let failedMessages = ""; for (const item of result.failedExpectations) { failedMessages += `${item.message} `; From 5fb9f12d3e92c746597627d8e8f105acd67785b4 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 8 Mar 2026 12:45:04 +0100 Subject: [PATCH 3/3] Ignore pending tests in the custom reporters Similar to excluded tests pending tests should not count towards runs or result in console logging because they are effectively not (fully) run. This reduces visual noise and helps to get the tests running on GitHub Actions where non-passed tests will count towards a non-zero exit code. --- test/integration/jasmine-boot.js | 12 ++++++++---- test/reporter.js | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/test/integration/jasmine-boot.js b/test/integration/jasmine-boot.js index 05e87cb4d..12891b8ba 100644 --- a/test/integration/jasmine-boot.js +++ b/test/integration/jasmine-boot.js @@ -52,10 +52,12 @@ async function runTests(results) { jasmineDone(suiteInfo) {}, jasmineStarted(suiteInfo) {}, specDone(result) { - // Report on the result of individual tests. - if (result.status === "excluded") { + // Ignore excluded (fit/xit) or skipped (pending) tests. + if (["excluded", "pending"].includes(result.status)) { return; } + + // Report on passed or failed tests. ++results.runs; if (result.status === "passed") { console.log(`TEST-PASSED | ${result.description}`); @@ -66,10 +68,12 @@ async function runTests(results) { }, specStarted(result) {}, suiteDone(result) { - if (result.status === "excluded") { + // Ignore excluded (fdescribe/xdescribe) or skipped (pending) suites. + if (["excluded", "pending"].includes(result.status)) { return; } - // Report on the result of `afterAll` invocations. + + // Report on failed suites only (indicates problems in setup/teardown). if (result.status === "failed") { ++results.failures; console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`); diff --git a/test/reporter.js b/test/reporter.js index 5e19b9097..25d9b6ab8 100644 --- a/test/reporter.js +++ b/test/reporter.js @@ -62,10 +62,12 @@ const TestReporter = function (browser) { this.specStarted = function (result) {}; this.specDone = function (result) { - if (result.status === "excluded") { + // Ignore excluded (fit/xit) or skipped (pending) tests. + if (["excluded", "pending"].includes(result.status)) { return; } - // Report on the result of individual tests. + + // Report on passed or failed tests. if (result.status === "passed") { sendResult("TEST-PASSED", result.description); } else { @@ -78,10 +80,12 @@ const TestReporter = function (browser) { }; this.suiteDone = function (result) { - if (result.status === "excluded") { + // Ignore excluded (fdescribe/xdescribe) or skipped (pending) suites. + if (["excluded", "pending"].includes(result.status)) { return; } - // Report on the result of `afterAll` invocations. + + // Report on failed suites only (indicates problems in setup/teardown). if (result.status === "failed") { let failedMessages = ""; for (const item of result.failedExpectations) {