-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Jest not able to find test specs in Windows 10 #1062
Comments
@eddyerburgh Got an idea? |
@nirkki can you try running:
I'm basing this off a stackoverflow answer. |
Same issue on Windows 7. Tried to run |
Didn't help here either. I also found some notes that Jest has had some issues with Windows paths containing special chars - but my project doesn't have those. |
Tried to troubleshoot this further: installing jest globally didn't make difference on 'npm run unit'
But if I give a path the result is the same as running npm run unit
|
I'm not sure what to suggest. It looks like Jest has some long standing issues with Windows that I was unaware of. All the issues I have looked at suggest that they won't be fixed by the maintainers any time soon 😕 |
Too bad, I'll revert back to Karma-Mocha. At least feel more like home there. Thanks for help! |
Sorry @nirkki . We'll probably move back to Karma and mocha as the default because of this issue |
@nirkki Can you post the full path of your tests. Does it include parentheses, like I'm pretty sure it has to do with this issue — jestjs/jest#2381 |
No paranthesis in the path |
Here is a working config for Windows 10: {
rootDir: "D:\\Mes documents\\GitHub\\livestorm-container\\livestorm-app",
roots: ["<rootDir>/app/frontend"],
moduleFileExtensions: [
"coffee",
"js",
"json",
"jsx",
"ts",
"vue",
"sass",
"scss",
"styl",
"css",
"png",
"svg",
"gif",
"jpeg",
"jpg"
],
moduleDirectories: [
"app/frontend",
"node_modules",
"app/frontend",
"app/frontend/packs",
"app/frontend/common/js/",
"app/frontend/common/vue",
"app/frontend/common/vue/components",
"app/frontend/api",
"app/frontend/config",
"config/locales-front",
"public"
],
moduleNameMapper: { "^@/(.*)$": "<rootDir>/app/frontend/$1" },
transform: {
"^.+.jsx?$": "<rootDir>/node_modules/babel-jest",
".*.(vue)$": "<rootDir>/node_modules/jest-vue"
},
mapCoverage: true,
snapshotSerializers: ["<rootDir>/node_modules/jest-serializer-vue"],
testPathIgnorePatterns: ["/node_modules/", "/vendors/"],
setupFiles: ["<rootDir>/test/frontend/jest-setup"]
} |
Windows 10 user here chipping in. I find it works if I run Additionally, manually running the |
@robertmain could you change the script to this: "unit": "jest test/unit --coverage", And see if that solves your issue |
FYI, my script is |
@nirkki @robertmain Could you please try with a clean project using |
Here we go! Now the coverage report for HelloWorld looks right, but for App.vue not quite...
|
Ap.vue is doesn'T have any tests, insofar the 0% are correct. However he lines numbers are off, which we will have to fix in vue-jest I assume, right @eddyerburgh ? We should also create a PR for this template to use @Akryum's config for windows compatibility. |
@LinusBorg There is one. 😄 |
Awesome, thanks :) |
@LinusBorg That's what I meant, the linenumbers. But if that's an vue-jest issue then this looks very promising! |
@nirkki @LinusBorg Yep this is a problem with vue-jest. Can you make an issue @nirkki https://github.com/eddyerburgh/vue-jest/issues? |
@eddyerburgh I doubt it will since that isn't where my test specs are
|
Fresh project with 'vue init webpack just-testing' doesn't find the test files in Win 10
...
25 files checked.
testMatch: /tests//.js?(x),**/?(.)(spec|test).js?(x) - 1 match
testPathIgnorePatterns: \node_modules\ - 25 matches
Pattern: test/unit/specs - 0 matches
The text was updated successfully, but these errors were encountered: