-
-
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
NPM Test - No Tests Found #6595
Comments
This is probably a limitation with Jest: jestjs/jest#1995 |
I was able to resolve this issue by using react-app-rewired and configuring jest inside of package.json. For anyone with similar issues, here is what I did:
The contents of my config-overrides.js file:
@bugzpodder It seems the real issue is that react-scripts does not support changing the jest configuration for testPathIgnorePatterns and transformIgnorePatterns so I need to rely on react-app-rewired for such changes. However, this could be very intentional so I'll close this issue since my original ticket is resolved. |
Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes
Which terms did you search for in User Guide?
testing, test configuration, jest, jest configuration, overriding pattern
Environment
System:
OS: macOS 10.14.3
CPU: x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 10.15.1 - /usr/local/bin/node
npm: 6.8.0 - /usr/local/bin/npm
Browsers:
Chrome: 72.0.3626.121
Safari: 12.0.3
npmPackages:
react: ^16.8.4 => 16.8.4
react-dom: ^16.8.4 => 16.8.4
react-scripts: ^2.1.8 => 2.1.8
npmGlobalPackages:
create-react-app: 2.1.8
Steps to Reproduce
(Write your steps here:)
mkdir node_modules
cd node_modules
create-react-app test
cd test
npm test
Expected Behavior
The test in App.test.js should have ran.
Actual Behavior
Step 5 output:
No tests found related to files changed since last commit.
Step 6 output:
PS: I totally understand that it cannot find any tests because the project is within the node_modules folder; however, this is something beyond my control. It seems though if I run
npm test
within a project regardless of what parent directory is, it should find those tests but ignore the node_modules that are child directories of the project.The text was updated successfully, but these errors were encountered: