Skip to content

Update to Jest 19 #1604

Description

@gaearon

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.

Activity

  1. added this to the milestone on Feb 21, 2017
  2. rogeliog commented on Feb 21, 2017

    @rogeliog
    Contributor

    I'm happy to do the update

  3. gaearon commented on Feb 21, 2017

    @gaearon
    ContributorAuthor

    Sounds good!

  4. TobiasBales commented on Apr 4, 2017

    @TobiasBales

    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

  5. gaearon commented on Apr 4, 2017

    @gaearon
    ContributorAuthor

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

    For the reference:

  6. biot023 commented on Apr 26, 2017

    @biot023

    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.

  7. Timer commented on Apr 26, 2017

    @Timer
    Contributor

    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)

  8. biot023 commented on Apr 26, 2017

    @biot023

    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!

  9. biot023 commented on Apr 26, 2017

    @biot023

    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! :)

  10. gaearon commented on Apr 26, 2017

    @gaearon
    ContributorAuthor

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

  11. biot023 commented on Apr 27, 2017

    @biot023

    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.

  12. ndelangen commented on Apr 28, 2017

    @ndelangen
    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.

  13. gaearon commented on May 16, 2017

    @gaearon
    ContributorAuthor

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

  14. locked and limited conversation to collaborators on Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions