mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-04 11:51:36 +02:00
Actually skip stale screenshot reporter on errors
This commit is contained in:
parent
1107ddf695
commit
8cae8df17f
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user