Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing jest-enzyme breaks npm test suite. #1957

Closed
csalvato opened this issue Apr 9, 2017 · 3 comments
Closed

Installing jest-enzyme breaks npm test suite. #1957

csalvato opened this issue Apr 9, 2017 · 3 comments

Comments

@csalvato
Copy link

csalvato commented Apr 9, 2017

Can you reproduce the problem with latest npm?

Yup!

Description

Installing jest-enzyme using the instructions outlined here causes the test suite to break.

image 2017-04-09 at 11 37 57 am

Test suite failed to run

    TypeError: expect.addSnapshotSerializer is not a function

      at Object.<anonymous> (node_modules/jest-enzyme/lib/index.js:23:8)
      at Object.<anonymous> (src/setupTests.js:1:156)

Expected behavior

Using jest-enzyme with src/setupTests.js as outlined in the docs should work.

Actual behavior

Using jest-enzyme with src/setupTests.js as outlined in the docs causes the test suite to fail.

Environment

npm ls react-scripts

react-scripts@0.9.5

node -v:

v6.10.0

npm -v

4.4.4

Operating system

OS X El Capitan 10.11.6

Browser and version:

N/A - this is in the command line

Reproducible Demo

https://github.com/csalvato/cra-jest-enzyme

@gaearon
Copy link
Contributor

gaearon commented Apr 9, 2017

See here: enzymejs/enzyme-matchers@f1f42ff.
Apparently their newest version depends on some Jest feature that hasn’t made it to our release yet.

Please use jest-enzyme@2.x in the meantime.

@gaearon
Copy link
Contributor

gaearon commented Apr 9, 2017

Documented in 798572a.

@csalvato
Copy link
Author

csalvato commented Apr 9, 2017

Terrific! Thank you!

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants