Skip to content
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 test command line fails when the project's path contains spaces #10

Open
zipang opened this issue Nov 23, 2018 · 0 comments
Open

Comments

@zipang
Copy link

zipang commented Nov 23, 2018

Hi everyone !

OK, looks like i've found the place to open this issue and a submit a PR.

After adding jest to my test envs and trying a bit test, i've got the following error :

15:30 $ bit test
utils/object-paths
tests failed
file: src/utils/object-paths/index.spec.js

❌   Jest failure
    Command failed: "/usr/local/bin/node" /Users/christophe/Workspace/My Projects/bit-boilerplate/.bit/components/testers/jest/bit.envs/0.0.34/node_modules/jest/bin/jest.js /Users/christophe/Workspace/My Projects/bit-boilerplate/src/utils/object-paths/index.spec.js --rootDir=/Users/christophe/Workspace/My Projects/bit-boilerplate/src/utils/object-paths --config=/Users/christophe/Workspace/My Projects/bit-boilerplate/.bit/components/testers/jest/bit.envs/0.0.34/dist/jest.config.js --json --outputFile="index-results.json"
internal/modules/cjs/loader.js:605
    throw err;
    ^

Error: Cannot find module '/Users/christophe/Workspace/My'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:775:12)
    at startup (internal/bootstrap/node.js:300:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:826:3)
 `"/usr/local/bin/node" /Users/christophe/Workspace/My Projects/bit-boilerplate/.bit/components/testers/jest/bit.envs/0.0.34/node_modules/jest/bin/jest.js /Users/christophe/Workspace/My Projects/bit-boilerplate/src/utils/object-paths/index.spec.js --rootDir=/Users/christophe/Workspace/My Projects/bit-boilerplate/src/utils/object-paths --config=/Users/christophe/Workspace/My Projects/bit-boilerplate/.bit/components/testers/jest/bit.envs/0.0.34/dist/jest.config.js --json --outputFile="index-results.json"` (exited with error code 1)

Which is obviously due to the fact the path to my project's folder contains a space...
The fix is obvious : just surround every path from the command line with "

zipang added a commit to zipang/bit.envs that referenced this issue Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants