-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
How to exclude tests from outside the src folder #4606
Comments
Can you provide a full repo? It's hard to tell what's wrong without seeing any source code. |
Its a private repo so i cant but theres no custom configuration related to jest. Heres our package.json and an image of the folder structure if that helps. Should it automatically exclude anything outside of the src folder?
|
Thanks for the extra information. What is the output of the test run and which tests were run but wasn't suppose to? I don't see any other directories in the screenshot. |
I had to remove the tests but they were in the root directory like this
and the output was |
It appears the config for jest has I suspect this is to be more lenient on how users want to organize their tests (in |
This should be strict on test matching in v2: testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx}',
'<rootDir>/src/**/?(*.)(spec|test).{js,jsx}',
], Please let us know if this still doesn't work right. |
I'm using react-scripts "1.1.4" and running
yarn test
is including a folder outside of the src directory. I thought based on this issue that was fixed #544. Is this a bug or is there a way to exclude anything outside of the src folder.The text was updated successfully, but these errors were encountered: