Skip to content

Commit

Permalink
fix: foo
Browse files Browse the repository at this point in the history
  • Loading branch information
dword-design committed Mar 13, 2021
1 parent 74c8137 commit 7a4f352
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ export const configureToMatchImageSnapshot = common => (
'Did you forget to pass `this` into expect().toMatchImageSnapshot(this)?'
)
}
const snapshotState = new jestSnapshot.SnapshotState(undefined, {
updateSnapshot: process.env.SNAPSHOT_UPDATE ? 'all' : 'new',
})
if (!context.snapshotState) {
context.snapshotState = new jestSnapshot.SnapshotState(undefined, {
updateSnapshot: process.env.SNAPSHOT_UPDATE ? 'all' : 'new',
})
}
const matcher = jestToMatchImageSnapshot.bind({
currentTestName: makeTestTitle(context.test),
snapshotState,
snapshotState: context.snapshotState,
testPath: context.test.file,
})
const result = matcher(received, { ...common, ...options })
Expand Down

0 comments on commit 7a4f352

Please sign in to comment.