Yes
I am using latest yarn 0.27.5
and npm 5.2.0
on Windows.
yarn test
or npm test
(is running script react-scripts test --env=jsdom
)After hitting a
You see:
No tests found
In C:\PROJECT
18490 files checked.
testMatch: C:\PROJECT\src\**\__tests__\**\*.js?(x),C:\PROJECT\src\**\?(*.)(spec|test).js?(x) - 6 matches
testPathIgnorePatterns: \\node_modules\\ - 18490 matches
Pattern: "" - 0 matches
No tests were executed but there are tests inside in PROJECT/src/ eg. default App.test.js - these tests are being executed when saving changes while in jest watch mode.
All tests inside src/**/*.test.js
should be executed
Using Windows 10 bash (ubuntu) it's running fine, so looks like it affects only Windows (tested on both - Win 7 & 10)
FYI Maybe it's related to https://github.com/facebook/jest/issues/4033
Hello. I can confirm this issue on my machine as well. Thanks to the note's temporary workaround (using bash), I'm able to execute my tests again.
My machine is running:
To make sure the issue isn't caused by my project's setup, I created a clean create-react-app project in C:\my-app
. The output of running all tests in an admin cmd prompt:
No tests found
In C:\my-app
14439 files checked.
testMatch: C:\my-app\src\**\__tests__\**\*.js?(x),C:\my-app\src\**\?(*.)(spec|test).js?(x) - 1 match
testPathIgnorePatterns: \\node_modules\\ - 14439 matches
Pattern: "" - 0 matches
The "1 match" will have to be the default src/App.test.js
file, created when running the create-react-app command. Still, no test is actually executed and the "No tests found" output is shown.
When run using bash on Windows, the output is:
yarn test v1.0.2
$ react-scripts test --env=jsdom
console.error node_modules\fbjs\lib\warning.js:33
Warning: React depends on requestAnimationFrame. Make sure that you load a polyfill in older browsers. http://fb.me/react-polyfills
PASS src\App.test.js
√ renders without crashing (24ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 2.772s
Ran all test suites related to changed files.
Hi,
I solved this issue by removing the locally installed watchman path variable. When running jest --verbose I got "@providesModule naming collision" warnings as reported in issue.
After removing the variable, jest is matching and executing all tests again.
Maybe this workaround helps some of you.
My system is running:
Thank you very much @zehbauer, removing watchman from my path env-var worked!
I'll close as that doesn't appear to be an issue on our side.
I can also reproduce this with a computer that has C:\tools\watchman
in its %PATH%
.
Seems like we should at least figure out what’s causing this.
Seems like this is fixed on Jest 22 so I'll close. We'll update to it soon.
As a temporary workaround you can run your tests with --no-watchman
, i.e. npm test -- --no-watchman
.
Most helpful comment
Seems like this is fixed on Jest 22 so I'll close. We'll update to it soon.
As a temporary workaround you can run your tests with
--no-watchman
, i.e.npm test -- --no-watchman
.