diff --git a/src/server/visual-diff-plugin.js b/src/server/visual-diff-plugin.js index c8faa357..970bf629 100644 --- a/src/server/visual-diff-plugin.js +++ b/src/server/visual-diff-plugin.js @@ -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 }) + ]); } } diff --git a/src/server/wtr-config.js b/src/server/wtr-config.js index dd21b77d..0c794e88 100644 --- a/src/server/wtr-config.js +++ b/src/server/wtr-config.js @@ -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); }