Skip to content

Commit a134785

Browse files
eps1lonKent C. Dodds
authored andcommitted
fix: avoid crash when importing without global expect (#56)
1 parent 60e5c07 commit a134785

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import prettierFormatter from './formatters/prettier'
33
import unstringSnapshotSerializer from './unstring-snapshot-serializer'
44

55
// istanbul ignore else (it's not worth testing)
6-
if (expect.addSnapshotSerializer) {
6+
if (typeof expect !== 'undefined' && expect.addSnapshotSerializer) {
77
expect.addSnapshotSerializer(unstringSnapshotSerializer)
88
}
99

0 commit comments

Comments
 (0)