From 0cd5c5f6e6118eeeb4b1d3b54ddb95407765e8a7 Mon Sep 17 00:00:00 2001 From: Chapman Pendery <35637443+cpendery@users.noreply.github.com> Date: Fri, 1 Mar 2024 13:38:53 -0500 Subject: [PATCH] feat: add summary message when a test.fail passes all retries (#7) Signed-off-by: Chapman Pendery --- src/reporter/base.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/reporter/base.ts b/src/reporter/base.ts index 36aabee..323fac8 100644 --- a/src/reporter/base.ts +++ b/src/reporter/base.ts @@ -266,6 +266,21 @@ export class BaseReporter { stdStreams ); }); + if ( + test.results.every((result) => result.error == null) && + test.outcome() === "unexpected" + ) { + const errorHeader = this._resultColor(test.outcome())( + this._header(test, ` ${failureIdx + 1}) `) + ); + process.stdout.write( + "\n" + + errorHeader + + "\n\n" + + padContent("Error: test passed when run with `test.fail`") + + "\n\n" + ); + } }); }