Skip to content

Ejecting causes Jest config to contain absolute paths #9993

Closed
@SimenB

Description

@SimenB

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions