Skip to content

Commit

Permalink
fix: avoid crash when importing without global expect (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored and Kent C. Dodds committed Dec 1, 2019
1 parent 60e5c07 commit a134785
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import prettierFormatter from './formatters/prettier'
import unstringSnapshotSerializer from './unstring-snapshot-serializer'

// istanbul ignore else (it's not worth testing)
if (expect.addSnapshotSerializer) {
if (typeof expect !== 'undefined' && expect.addSnapshotSerializer) {
expect.addSnapshotSerializer(unstringSnapshotSerializer)
}

Expand Down

0 comments on commit a134785

Please sign in to comment.