Repository navigation
Update to Jest 19 #1604
Description
Activity
I'm happy to do the update
Sounds good!
Any news on this?
Update: just saw the pr and noticed the let's hold off until x and y are fixed list, oh wellYou can help fixing them. 😉
I think those are pretty important blockers and we shouldn't ship this to CRA audience.For the reference:
Hi -- it looks like jest is pretty much broken with the current CRA release.
I'm getting aTypeError: Cannot read property of 'bind' of undefinederror.
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.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)
Hi -- I haven't ejected, so that should be okay.
So I shouldyarn uninstall jest jest-cli, as they are the only two packages mentioned in my packages.json file?
I'll give that a try -- thankyou!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! :)
No worries! If you remember why you tried to do it (e.g. a confusing guide) let us know!
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.
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.
Please help beta test the new version that includes this change!
#2172- locked and limited conversation to collaborators
on Jan 21, 2019
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.