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

Update to Jest 19 #1604

Closed
gaearon opened this issue Feb 21, 2017 · 12 comments
Closed

Update to Jest 19 #1604

gaearon opened this issue Feb 21, 2017 · 12 comments
Milestone

Comments

@gaearon
Copy link
Contributor

gaearon commented Feb 21, 2017

Seems like a pretty sweet release: http://facebook.github.io/jest/blog/2017/02/21/jest-19-immersive-watch-mode-test-platform-improvements.html.

This is a breaking change so targeting 0.10. A PR to update is welcome.
Also worth keeping an eye on jestjs/jest#2957.

@gaearon gaearon added this to the 0.10.0 milestone Feb 21, 2017
@rogeliog
Copy link
Contributor

I'm happy to do the update

@gaearon
Copy link
Contributor Author

gaearon commented Feb 21, 2017

Sounds good!

@TobiasBales
Copy link

TobiasBales commented Apr 4, 2017

Any news on this?
Update: just saw the pr and noticed the let's hold off until x and y are fixed list, oh well

@gaearon
Copy link
Contributor Author

gaearon commented Apr 4, 2017

You can help fixing them. 😉
I think those are pretty important blockers and we shouldn't ship this to CRA audience.

For the reference:

@biot023
Copy link

biot023 commented Apr 26, 2017

Hi -- it looks like jest is pretty much broken with the current CRA release.
I'm getting a TypeError: Cannot read property of 'bind' of undefined error.
Googling it brings this up: jestjs/jest#3114
I'm rather new to the entire react/jest/yarn/etc. ecosystem, so sorry if I'm getting this wrong.
Is there some way I can update jest for my local app? I've tried updating jest-cli and jest to the latest versions, but I get the same error and can still see references to 1.8 versions in the yarn.lock file.
Cheers,
Doug.

@Timer
Copy link
Contributor

Timer commented Apr 26, 2017

Hey! You don't need to install any jest packages for it to work with CRA.
Unfortunately, this also means you can't upgrade Jest until we do in the 0.10 release.

Please uninstall all jest related packages and try npm test again.

(this all assumes you haven't ejected)

@biot023
Copy link

biot023 commented Apr 26, 2017

Hi -- I haven't ejected, so that should be okay.
So I should yarn uninstall jest jest-cli, as they are the only two packages mentioned in my packages.json file?
I'll give that a try -- thankyou!

@biot023
Copy link

biot023 commented Apr 26, 2017

Bingo! I must have tried a manual install of jest (I don't remember doing it, but I must have) and that screwed things up -- thankyou so much! :)

@gaearon
Copy link
Contributor Author

gaearon commented Apr 26, 2017

No worries! If you remember why you tried to do it (e.g. a confusing guide) let us know!

@biot023
Copy link

biot023 commented Apr 27, 2017

I think I just assumed I needed to add it explicitly -- so more a case of not reading the guide properly, as opposed to being confused by it.

@ndelangen
Copy link
Contributor

I'm getting this as well in react-storybook: #1604 (comment)

In our case we're using lerna with hoisting and somehow this is causing problems in a create-react-app + storybook example:

lerna ERR! test Errored while running script in 'cra-storybook'
lerna ERR! execute Error: Command failed: npm run test
lerna ERR! execute  FAIL  src/App.test.js
lerna ERR! execute   ● Test suite failed to run
lerna ERR! execute 
lerna ERR! execute     TypeError: Cannot read property 'bind' of undefined
lerna ERR! execute       
lerna ERR! execute       at Runtime._createRuntimeFor (../../node_modules/react-scripts/node_modules/jest-runtime/build/index.js:709:52)
lerna ERR! execute       at process._tickCallback (internal/process/next_tick.js:109:7)
lerna ERR! execute 
lerna ERR! execute Test Suites: 1 failed, 1 total
lerna ERR! execute Tests:       0 total
lerna ERR! execute Snapshots:   0 total
lerna ERR! execute Time:        0.906s
lerna ERR! execute Ran all test suites.

Full log here: https://travis-ci.org/storybooks/storybook/builds/226783695#L2102

For now I have disabled lerna hoisting and it appears this resolves the issue.

@gaearon
Copy link
Contributor Author

gaearon commented May 16, 2017

Please help beta test the new version that includes this change!
#2172

@lock lock bot locked and limited conversation to collaborators Jan 21, 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

6 participants