Merge pull request #248 from element-hq/t3chguy/missing-return

This commit is contained in:
Michael Telatynski 2026-04-08 12:56:47 +01:00 committed by GitHub
commit ee404f098b

View File

@ -56,11 +56,7 @@ class StaleScreenshotReporter implements Reporter {
this.success = false;
}
public async onExit(): Promise<void> {
if (this.failing.size) {
console.error(`${this.failing.size} tests failed, skipping stale screenshot reporter.`);
}
private async checkStaleScreenshots(): Promise<void> {
if (!this.snapshotRoots.size) {
this.error("No snapshot directories found, did you set the snapshotDir in your Playwright config?", "");
return;
@ -90,6 +86,14 @@ class StaleScreenshotReporter implements Reporter {
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) {
process.exit(1);