Tests outside of src folder shouldn't be run
See original GitHub issueThe README.md says:
The .test.js / .spec.js files (or the __tests__ folders) can be located at any depth under the src top level folder.
However, if I create a .spec.js
in a e2e
folder at the root of the project, it is still executed by npm test
I guess that’s a bug. Right now I can workaround by overriding the testPathPattern
parameter in my package.json
: react-scripts test --env=jsdom --testPathPattern ./src\/.*
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Running Jest on TypeScript tests in non-src folders of a React ...
I can't be the only one that wants to run tests on server code in TypeScript in a React application. UPDATE I tried...
Read more >Do you put tests outside the `tests/` folder? - Elm Discourse
Yes. I generally put tests inside the module they are meant to test. A lot of people point out that you shouldnt test...
Read more >How To Structure React Projects From Beginner To Advanced
Outside the src folder your files will be very project dependent so there is no good universal structure to apply since it will...
Read more >Organizing Gradle Projects - Gradle User Manual
Optimally, the test source code for each test type should be stored in dedicated source directories. Separated test source code has a positive...
Read more >Bundling Extensions - Visual Studio Code
src /extension.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node", "esbuild": "npm run esbuild-base -- --sourcemap", ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’d like to place all test files outside of
src
. Do I need to eject?Interesting, thanks for writing up. I probably forgot to limit this. Now that I think of it I think maybe we should allow them to be in top level
src
,test
,tests
and__tests__
.