Skip to content

Commit

Permalink
Code review refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
svanherk committed Jun 22, 2023
1 parent baecb3b commit 7f5c520
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/server/visual-diff-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ async function clearDir(updateGoldens, path) {
if (updateGoldens) {
await rm(path, { force: true, recursive: true });
} else {
await rm(join(path, PATHS.FAIL), { force: true, recursive: true });
await rm(join(path, PATHS.PASS), { force: true, recursive: true });
await rm(join(path, 'report.html'), { force: true });
await Promise.all([
rm(join(path, PATHS.FAIL), { force: true, recursive: true }),
rm(join(path, PATHS.PASS), { force: true, recursive: true }),
rm(join(path, 'report.html'), { force: true })
]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/wtr-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class WTRConfig {
//config.reporters.push(visualDiffReporter());

config.plugins ??= [];
config.plugins.push(visualDiff({ updateGoldens: golden, runSubset: filter?.length > 0 || grep?.length > 0 }));
config.plugins.push(visualDiff({ updateGoldens: golden, runSubset: !!(filter || grep) }));

config.groups.push(this.visualDiffGroup);
}
Expand Down

0 comments on commit 7f5c520

Please sign in to comment.