I just upgraded from jest 14.1.0 to jest 15.0.2 and now no tests are found anymore - the testPathDir never matches anything (I tried different variations). Output is:
No tests found
41 files checked.
testPathDirs: C:Usersdskgryappsrc - 0 matches
testRegex: tests/.*Test.js - 9 matches
testPathIgnorePatterns: node_modules - 41 matches
Debug file attached.
Thanks in advance
jest_debug.txt
Same, it seems to only find my real module files, not the files in my __tests__ directory.
Same, only works in v14.1.0
Can someone provide a repository that I can install on windows to test this? Seems like 15 works on windows but you have a configuration that isn't quite compatible.
Here's the repro: https://github.com/ManuelDeLeon/jest-issue-1551
It only has 2 files:
package.json
{
"name": "jest-issue-1551",
"version": "1.0.0",
"scripts": {
"test": "jest"
},
"devDependencies": {
"jest-cli": "^15.0.0"
},
"jest": {
"testRegex": "\\.test\\.js$",
"testPathDirs": [
"src"
]
}
}
srcsome.test.js
describe('Test', () => {
it('works', () => {
expect(true).toBe(true);
});
});
With v14:
C:\MyFiles\React\repros\jest-issue-1551>npm test
> [email protected] test C:\MyFiles\React\repros\jest-issue-1551
> jest
Using Jest CLI v14.1.0, jasmine2, babel-jest
PASS src\some.test.js (0.73s)
1 test passed (1 total in 1 test suite, run time 1.706s)
With v15:
C:\MyFiles\React\repros\jest-issue-1551>npm test
> [email protected] test C:\MyFiles\React\repros\jest-issue-1551
> jest
No tests found
1 file checked.
testPathDirs: C:\MyFiles\React\repros\jest-issue-1551\src - 0 matches
testRegex: \.test\.js$ - 1 match
testPathIgnorePatterns: \\node_modules\\ - 1 match
The dash in testPathDirs is the issue here.
From my ticket...
Jest 15.1.0
Node v4.4.7
NPM 3.10.6
Windows 10
Since the update to Jest 15, no more tests are found.
C:\idea\myproject replaced to C:\idea\my-projectThen execute npm test.
No tests found
...
testPathDirs: C:\idea\my-project - 0 matches
The tests are found.
Here is the relevant info...
"testPathDirs": [
"C:\\idea\\my-project"
]
The dash is not escaped.
Probably related to this pull request...
Is it resolved? I'm facing the same problem...
Thanks for the repros. @Daniel15 is our resident windows expert. We are hoping to have a fix for this sometime tomorrow. Please be patient, it's a bit hard sometimes to keep up.
I'll try to take a look at this tonight. All the known issues should have been resolved by #1463, I'll need to investigate further and determine what broke.
Unfortunately we don't have automated builds on Windows yet. Currently, several of Jest's unit tests are broken on Windows. We're aiming to fix all those issues and enable an AppVeyor build (#1465) to more easily catch Windows-specific regressions in the future.
I think @cpojer is right that #1574 should fix this. So far I've only been able to replicate the issue for folder names containing hyphens.
Published 15.1.1 with a fix. Sorry for the wait!
Man, amazing job!!! It's working perfectly now.
1° Thor
2° God
3° @cpojer ;-)
Thanks for all!!!!
Hey, I didn't do anything! All credit goes to @insin who troubleshooted it and sent a PR and @Daniel15 who helped verify.
Thanks. I love you so much that it hurts :)
I'm still getting this issue on 15.1.1, but there aren't any dashes in my path.
There are . characters in the path, but they don't seem to be the cause as replacing them with anything else makes no difference.
There are also spaces, and it seems like that might be the cause as when I move the project directory right down to C:\myprojectname it then begins to find the tests correctly, but won't find any when the directory is like C:\My Directory\myprojectname.
Is this related to the same bug, or should I file a new report?
Hi @dylanparry! I'd suggest filing a new issue so we can look into it. I think we'll add some integration tests to test scenarios like this.
Thanks. I'll file a bug now.
Hi, I am now learning react and using react-scripts wich actually runs jest
I am having the same bug of "No tests found" and 0 matches.. tried to run by script {'test': 'jest'} and of course update to the latest version of jest (npm install --save-dev jest@^) and got 15.1.1
but still no test found. It's driving me crazy hope someone can help.
No tests found
7 files checked.
testPathDirs: C:UsersUserDesktoplearning reactvode-client - 0 matches
testRegex: (/tests/.*|.(test|spec)).(js|jsx)$ - 2 matches
testPathIgnorePatterns: C:UsersUserDesktoplearning reactvode-client(build|docs|node_modules) - 7 matches
It seems like there is also a bug with spaces in dir names on windows. See #1639 – we'll fix it in the next Jest release.
Having the same issue running 21.2.1
I'm on windows 10.
+, space, and . are in the path.
I am having the same issue running 21.2.1 with windows
@tedtang77 try v23, there have been couple of windows fixes since v21
It works on v23! Thanks very much
Most helpful comment
@tedtang77 try v23, there have been couple of windows fixes since v21