From 7a0560231f8afc1310cb4c0f4e43497a085df6ef Mon Sep 17 00:00:00 2001 From: Stacey Van Herk <13419300+svanherk@users.noreply.github.com> Date: Thu, 22 Jun 2023 09:38:46 -0400 Subject: [PATCH] Simplify promise code Co-authored-by: Dave Lockhart --- src/server/visual-diff-plugin.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/server/visual-diff-plugin.js b/src/server/visual-diff-plugin.js index c44e0f28..8b779634 100644 --- a/src/server/visual-diff-plugin.js +++ b/src/server/visual-diff-plugin.js @@ -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); } }