Skip to content

Commit

Permalink
Simplify promise code
Browse files Browse the repository at this point in the history
Co-authored-by: Dave Lockhart <[email protected]>
  • Loading branch information
svanherk and dlockhart committed Jun 22, 2023
1 parent 11cbfac commit 7a05602
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/server/visual-diff-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,9 @@ export function visualDiff({ updateGoldens = false, runSubset = false } = {}) {

if (runSubset || currentRun > 0) {
if (!clearedDirs.has(newPath)) {
const promise = clearDir(updateGoldens, newPath);
clearedDirs.set(newPath, promise);
await promise;
} else {
await clearedDirs.get(newPath);
clearedDirs.set(newPath, clearDir(updateGoldens, newPath));
}
await clearedDirs.get(newPath);
}
}

Expand Down

0 comments on commit 7a05602

Please sign in to comment.