diff --git a/core/test_case.ts b/core/test_case.ts index deec473..30b2c43 100644 --- a/core/test_case.ts +++ b/core/test_case.ts @@ -299,7 +299,7 @@ export interface TestGroupOptions { } - printReport(short = false, logger?:Datex.Logger){ + printReport(short = false, logger?:Datex.Logger) { if (short) return this.printReportShort(logger) else return this.printReportLong(logger) } @@ -376,6 +376,8 @@ export interface TestGroupOptions { } _logger.flush(); + + return this.state == TEST_CASE_STATE.SUCCESSFUL; } async printReportShort(_logger = logger) { @@ -421,6 +423,8 @@ export interface TestGroupOptions { _logger.flush(); + + return ownState == TEST_CASE_STATE.SUCCESSFUL } private formatError(error:any) { diff --git a/core/test_manager.ts b/core/test_manager.ts index 921fb4f..7046366 100644 --- a/core/test_manager.ts +++ b/core/test_manager.ts @@ -128,8 +128,8 @@ Logger.production_log_level = LOG_LEVEL.DEFAULT; // log level for normal logs (l let successful = true; for (const context of contexts) { for (const group of this.tests.get(context.toString())?.values()??[]) { - await group.printReport(short, logger); - if (group.state != TEST_CASE_STATE.SUCCESSFUL) successful = false; + const groupSuccessful = await group.printReport(short, logger); + if (!groupSuccessful) successful = false; } } if (short) console.log(""); // margin top