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

Ejecting causes Jest config to contain absolute paths #9993

Closed
SimenB opened this issue Nov 2, 2020 · 2 comments · Fixed by #11338
Closed

Ejecting causes Jest config to contain absolute paths #9993

SimenB opened this issue Nov 2, 2020 · 2 comments · Fixed by #11338
Milestone

Comments

@SimenB
Copy link
Contributor

SimenB commented Nov 2, 2020

Describe the bug

Ejecting from a fresh CRA project puts "testRunner": "/Users/simen/repos/my-app/node_modules/jest-circus/runner.js" in my Jest config in package.json, which will obviously only work on my machine (barring some weird coincidences)

Did you try recovering your dependencies?

N/A

Which terms did you search for in User Guide?

N/A

Environment

Environment Info:

  System:
    OS: macOS 10.15.7
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 14.15.0 - ~/.nvm/versions/node/v14.15.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.15.0/bin/npm
  Browsers:
    Chrome: 86.0.4240.111
    Firefox: 81.0.2
    Safari: 14.0
  npmPackages:
    react: ^17.0.1 => 17.0.1
    react-dom: ^17.0.1 => 17.0.1
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. npx create-react-app my-app
  2. cd my-app && yarn eject
  3. Look at Jest config in package.json

Expected behavior

I'd expect it to see "testRunner": "jest-circus/runner" in package.json.

Actual behavior

I see "testRunner": "/Users/simen/repos/my-app/node_modules/jest-circus/runner.js" instead

Reproducible demo

N/A

@celineotter
Copy link

Any resolutions?
I m hitting the same after running eject too

@celineotter
Copy link

Actually, resolved as above suggested
replace user path with"testRunner": "jest-circus/runner"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants