@empiricalrun/reporter
Advanced tools
Comparing version 0.23.0 to 0.23.1
# @empiricalrun/reporter | ||
## 0.23.1 | ||
### Patch Changes | ||
- 9a81634: fix: updated implementation for fetching commit SHA | ||
- f2c3344: fix: hitting maxFailures is not an error scenario | ||
## 0.23.0 | ||
@@ -4,0 +11,0 @@ |
@@ -25,3 +25,3 @@ export type Results = { | ||
reportExists(): Promise<boolean>; | ||
hasRunFailed(): boolean; | ||
hasRunFailedWithError(): boolean; | ||
resultsSummary(): Results; | ||
@@ -28,0 +28,0 @@ failedTests(): FailedTestWithLink[]; |
@@ -18,3 +18,3 @@ import { JSONReport as PlaywrightJSONReport } from "@playwright/test/reporter"; | ||
getTestIdForTestName(testName: string): string; | ||
hasRunFailed(): boolean; | ||
hasRunFailedWithError(): boolean; | ||
failedTests(): FailedTestWithLink[]; | ||
@@ -21,0 +21,0 @@ reportLink(filter?: PlaywrightReportFilter): string; |
@@ -75,5 +75,16 @@ "use strict"; | ||
} | ||
hasRunFailed() { | ||
const results = (0, utils_1.parseJsonReport)(this.srcFile); | ||
return results?.errors?.length > 0; | ||
hasRunFailedWithError() { | ||
try { | ||
const results = (0, utils_1.parseJsonReport)(this.srcFile); | ||
// This can be non-zero if the run hits maxFailure config. We don't consider | ||
// that as an error scenario | ||
const totalTestsExecuted = results.stats.expected + results.stats.unexpected + results.stats.flaky; | ||
const noTestsWereExecuted = totalTestsExecuted === 0; | ||
// Top level errors include: hitting maxFailures, no tests were found for filter | ||
const hasTopLevelError = results?.errors?.length > 0; | ||
return hasTopLevelError && noTestsWereExecuted; | ||
} | ||
catch (err) { | ||
return true; | ||
} | ||
} | ||
@@ -80,0 +91,0 @@ failedTests() { |
@@ -48,3 +48,3 @@ "use strict"; | ||
const reportNotGenerated = !(await reportSource.reportExists()); | ||
if (reportNotGenerated || reportSource.hasRunFailed()) { | ||
if (reportNotGenerated || reportSource.hasRunFailedWithError()) { | ||
await Promise.all(sinks.map((s) => s.sendMessageForError())); | ||
@@ -51,0 +51,0 @@ } |
{ | ||
"name": "@empiricalrun/reporter", | ||
"version": "0.23.0", | ||
"version": "0.23.1", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "registry": "https://registry.npmjs.org/", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
51896
928