Actually skip stale screenshot reporter on errors
This commit is contained in:
@@ -56,11 +56,7 @@ class StaleScreenshotReporter implements Reporter {
|
|||||||
this.success = false;
|
this.success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async onExit(): Promise<void> {
|
private async checkStaleScreenshots(): Promise<void> {
|
||||||
if (this.failing.size) {
|
|
||||||
console.error(`${this.failing.size} tests failed, skipping stale screenshot reporter.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.snapshotRoots.size) {
|
if (!this.snapshotRoots.size) {
|
||||||
this.error("No snapshot directories found, did you set the snapshotDir in your Playwright config?", "");
|
this.error("No snapshot directories found, did you set the snapshotDir in your Playwright config?", "");
|
||||||
return;
|
return;
|
||||||
@@ -90,6 +86,14 @@ class StaleScreenshotReporter implements Reporter {
|
|||||||
this.error("Stale screenshot file", screenshot);
|
this.error("Stale screenshot file", screenshot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async onExit(): Promise<void> {
|
||||||
|
if (this.failing.size) {
|
||||||
|
this.error(`${this.failing.size} tests failed, skipping stale screenshot reporter.`, "");
|
||||||
|
} else {
|
||||||
|
await this.checkStaleScreenshots();
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.success) {
|
if (!this.success) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user