-
Notifications
You must be signed in to change notification settings - Fork 294
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
The meaning of the root path parameter #571
Comments
try to set your |
Cross-referencing jest-community/jest-editor-support#44. |
re-reading this issue makes me wonder if there is a bug with rootPath on windows... Setting rootPath to "D:/myproject/Frontend/app/" should be correct, this will set the Meanwhile, feel free to give the latest v4.0.0-alpha.5 release a try, which fixed quite a few issues accumulated through the years. |
Closed due to inactivity and accumulated changes over time, possibly making it outdated. Feel free to reopen if it remains relevant. |
Environment
node -v
: v10.16.2npm -v
: 6.10.3npm ls jest
ornpm ls react-scripts
(if you haven’t ejected): jest@24.9.0your vscode-jest settings if customized:
Operating system: Win 10
Prerequisite
npm run test
ornode_modules/.bin/jest
) npm run testSteps to Reproduce
create a react project with the following structure:
projectfolder (myproject)
jest.pathToJest? npm test
jest.pathToConfig? D:/myproject/Frontend/app/jest.config.js
Relevant Debug Info
ERR! enoent ENOENT: no such file or directory, open 'd:\myproject\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
Expected Behavior
I got the above error and I thought: "this is what Root Path" is for, even if I was confused by the desciption. So that he would not try to find the package.json in the root of my project (d:\myproject) but in the "npm root".
Then I put in the config:
Which gave me another error instead:
It took me a while to come back to the jest.rootPath parameter. And when I deleted it, I got the first error back, which I resolved by not using "npm test" but "D:/myproject/Frontend/app/node_modules/.bin/jest" for pathToJest, which caused another problem that does not seem to be related to the usage or configuration of this project.
What purpose serves the rootPath parameter? I've read in other issues that people did wonder.
It does not seem to denote the path to the folder I call npm root, which is what I had hoped for.
If it is to denote the path to the script files? Isn't this what a jest.config is for and wouldn't the two cancel each other out or something?
I have the problem that if I start my tests with "npm test" it goes like expected but If I run them with the excecutable (D:/myproject/Frontend/app/node_modules/.bin/jest) they all fail because of some error that originates from within my configuration or jest or else...
And it is the same on console or VS Code.
So that's why I would like to use "npm run", but I can't
The text was updated successfully, but these errors were encountered: