From 0e89f3c06c110aa011cde57a6b6c3466a258d259 Mon Sep 17 00:00:00 2001 From: Danny Gleckler Date: Sat, 24 Jun 2023 09:34:11 -0400 Subject: [PATCH] Clean up command opts --- src/server/visual-diff-plugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/visual-diff-plugin.js b/src/server/visual-diff-plugin.js index 970bf629..ca7f70d6 100644 --- a/src/server/visual-diff-plugin.js +++ b/src/server/visual-diff-plugin.js @@ -129,8 +129,8 @@ export function visualDiff({ updateGoldens = false, runSubset = false } = {}) { } } - const opts = payload.opts || {}; - opts.margin = opts.margin || DEFAULT_MARGIN; + const opts = { ...payload.opts }; + opts.margin ??= DEFAULT_MARGIN; const page = session.browser.getPage(session.id); await page.screenshot({