Skip to content

Commit e0f08ed

Browse files
committed
fix(browser): toMatchScreenshot should not generate screenshot on match
1 parent 0300fdb commit e0f08ed

File tree

1 file changed

+11
-1
lines changed
  • packages/browser/src/node/commands/screenshotMatcher

1 file changed

+11
-1
lines changed

packages/browser/src/node/commands/screenshotMatcher/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ async function determineOutcome(
148148
}
149149

150150
// no reference to compare against - create one based on update settings
151-
if (reference === null || updateSnapshot === 'all') {
151+
if (reference === null) {
152152
if (updateSnapshot === 'all') {
153153
return {
154154
type: 'update-reference',
@@ -190,6 +190,16 @@ async function determineOutcome(
190190
return { type: 'matched-after-comparison' }
191191
}
192192

193+
if (updateSnapshot === 'all') {
194+
return {
195+
type: 'update-reference',
196+
reference: {
197+
image: screenshot,
198+
path: paths.reference,
199+
},
200+
}
201+
}
202+
193203
return {
194204
type: 'mismatch',
195205
reference: {

0 commit comments

Comments
 (0)