From baa37ece0d027ca6d57fd5b52ceedfaa97ecbfaa Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Thu, 1 Aug 2024 13:42:41 -0400 Subject: [PATCH] test: Updated custom test reporter to only log failed tests when there are failures (#2425) --- test/lib/test-reporter.mjs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/lib/test-reporter.mjs b/test/lib/test-reporter.mjs index 6c47ee2b4d..e55f0d0ff7 100644 --- a/test/lib/test-reporter.mjs +++ b/test/lib/test-reporter.mjs @@ -55,9 +55,11 @@ async function* reporter(source) { } } - yield `\n\nFailed tests:\n` - for (const file of failed) { - yield `${file}\n` + if (failed.size > 0) { + yield `\n\nFailed tests:\n` + for (const file of failed) { + yield `${file}\n` + } } yield `\n\nPassed: ${passed.size}\nFailed: ${failed.size}\nTotal: ${passed.size + failed.size}\n` }