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] 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} `;