Skip to content

Commit a36c3be

Browse files
authored
refactor(browser): restructure screenshot matcher and add documentation (#9243)
1 parent dd03316 commit a36c3be

6 files changed

Lines changed: 354 additions & 144 deletions

File tree

packages/browser/src/client/tester/expect/toMatchScreenshot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default async function toMatchScreenshot(
7878
}
7979

8080
if (result.diff) {
81-
attachments.push({ name: 'diff', path: result.diff })
81+
attachments.push({ name: 'diff', ...result.diff })
8282
}
8383

8484
if (attachments.length > 0) {
@@ -107,7 +107,7 @@ export default async function toMatchScreenshot(
107107
? `\nActual screenshot:\n ${this.utils.RECEIVED_COLOR(result.actual.path)}`
108108
: null,
109109
result.diff
110-
? this.utils.DIM_COLOR(`\nDiff image:\n ${result.diff}`)
110+
? this.utils.DIM_COLOR(`\nDiff image:\n ${result.diff.path}`)
111111
: null,
112112
'',
113113
]

0 commit comments

Comments
 (0)