You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running yarn test in a react-native project where the node_modules are symlinked doesn't seem to work:
$ yarn test
yarn run v1.12.3
$ node ./node_modules/jest/bin/jest.js
FAIL components/__tests__/StyledText-test.js
● Test suite failed to run
Cannot find module 'setupDevtools' from 'setup.js'
at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:221:17)
at Object.<anonymous> (../node_modules/react-native/jest/setup.js:3:6)
We want this to work, because this is how Stryker's sandboxes work. They create a temp folder inside your project, copy all source files into the sandbox dir and symlink the node_modules. Original issue here: stryker-mutator/stryker-js#717
Reproducible Demo
I've prepared a small git repository to demonstrate the problem. I've created this repository with expo init (choosing the more extensive "tab" setup). After that I've installed the latest version of react-native: yarn add react-native. After that I've created an example "sandbox" directory with a copy of all sources. https://github.com/nicojs/jest-react-native-symlink-test
You can use these commands to reproduce the issue:
git clone https://github.com/nicojs/jest-react-native-symlink-test
cd jest-react-native-symlink-test
yarn install
yarn symlink # <-- this will symlink the node_modules under the sandbox directorycd sandbox
yarn test
The text was updated successfully, but these errors were encountered:
I think it is a known issue/design decision for Jest jestjs/jest#1477 not to follow symlinks. Checkout the workarounds at that issue for possible solutions to your problem (roots config).
Environment
Description
Running
yarn test
in a react-native project where the node_modules are symlinked doesn't seem to work:We want this to work, because this is how Stryker's sandboxes work. They create a temp folder inside your project, copy all source files into the sandbox dir and symlink the node_modules. Original issue here: stryker-mutator/stryker-js#717
Reproducible Demo
I've prepared a small git repository to demonstrate the problem. I've created this repository with
expo init
(choosing the more extensive "tab" setup). After that I've installed the latest version of react-native:yarn add react-native
. After that I've created an example "sandbox" directory with a copy of all sources.https://github.com/nicojs/jest-react-native-symlink-test
You can use these commands to reproduce the issue:
The text was updated successfully, but these errors were encountered: