node -v: 10.5npm -v: 6.1sorry, it is not clear what "blanks" mean? blank space of folder name? empty folder? does it work when the folder is not "blank"? best to provide an example repo as the template has suggested...
blank spaces... like "VS Code"... as soon as they are replaced, everything is fine.
interesting... vscode-jest doesn't officially support multi-root, i.e. it only operates under the current root... is this folder the root folder or a sub-folder?
@connectdotz thanks a lot for the quick replies! :) the main folder for the multi-root workspace had blanks in its name. under that folder there are root-folders for each sub-project.
@connectdotz Any workaround? I also cant use jest vscode plugin because my project has a parent folder which contains a space inside its name.
Maybe somehow using windows cmd "subst" command to map the folder to "P:\" and run from there?
this is indeed a bug that we did the plain string split when spawning the process in Process.js of jest-editor-supports package (this fix should be pretty straightforward, if anybody is interested in submitting a PR to address this, I can help to answer any question you have...)
meanwhile, you can try to use the scripts in package.json to hide the path then customize your js.pathToJest to point to it. For example:
in your root package.json, add a test script if not already exist
"scripts": {
"test": "jest" // make sure you can run this script from commandline
}
in .vscode/settings.json, customize jest.pathToJest:
"jest.pathToJest": "yarn test" // or `npm run test --`
that should get you around the bug until it is fixed.
@connectdotz I get now:
ERR! code ELIFECYCLE
and from some reason the plugin tries to run:
ERR! [email protected] test: jest --no-cache "C:\Users\user1\AppData\Local\Temp/jest_runner.json"
why does it add /jest_runner.json with a forward slash?
on the other hand running "npm run test" in the command line from the project root folder works.
Fixed by using:
"jest.pathToJest": "npm run test --"
instead of
"jest.pathToJest": "npm run test"
great.
this root cause can be fixed in jest-editor-supports package, should be pretty straightforward, anybody who wants to get your feet wet, this might be a good opportunity...
This problem seems to be worse for me now, the previous band aid no longer works for me.
the last pattern starts at "Swartz" and then the jest_runner.json has a forward slash instead of matching the back slashes.
No tests found
In C:\Users\Cody Swartz\Desktop\projects\others projects\bot
47 files checked.
testMatch: - 47 matches
testPathIgnorePatterns: \\node_modules\\ - 47 matches
testRegex: __tests__\\.*.(test|spec).ts$ - 13 matches
Pattern: Swartz\AppData\Local\Temp\\jest_runner.json - 0 matches
Exception raised: JSON report not found at C:\Users\Cody Swartz\AppData\Local\Temp/jest_runner.json
It also happens with special characters for me.
'a:\Work\Mega\Work\�' is not recognized as an internal or external command,
operable program or batch file.
Most helpful comment
Fixed by using:
"jest.pathToJest": "npm run test --"
instead of
"jest.pathToJest": "npm run test"