-
Notifications
You must be signed in to change notification settings - Fork 293
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
Debug w/ Create React App does not seem to work. #239
Comments
ha - seems that modifying the settings.json file to the following works:
UPDATE: - Unfortunately, import statements now seem to fail in the tests. |
Well that's confusing, I was thinking it was the same as #193. |
Hey! So I was experiencing the exact same problem, and it turned out I needed to add a
You may need to restart vscode, but I'm not totally sure. |
Hi ! I'm having the same issue, even with a .babelrc as described by @beaksandclaws. What is the right config for jest.pathToJest ? Or is this more than just finding the right config ? Alain |
Maybe this extension is running jest directly instead of using react-scripts. Which causes problems because react-scripts introduce configurations for ES6/jsx syntax. Which is why @justinlevi got a problem with imports. |
This is the same issue as #193. Directly suppling jest to For your information, #271 should bring support for debugging projects created by |
I'm closing it since it got resolved with today's update. |
That's worked for me. Thank you. Seems like it is the easiest solutions. |
In same way, and for those who don't like having a lot of configuration file at root of their projects, you can add this to your package.json: "babel": {
"presets": [
"react-app"
]
} |
Environment
node -v
: 8.9.4npm -v
: 5.6.0npm ls react-scripts
(if you haven’t ejected): react-scripts@1.0.17Operating system: OSX 10.13.2
Steps to Reproduce
vscode-jest
installednpx create-react-app my-app
cd my-app && yarn add @types/jest
.vscode/launch.json
file and add the following configuration, from thecreate-react-app
readme.source: https://github.com/facebook/create-react-app/blob/ed5c48c81b2139b4414810e1efe917e04c96ee8d/packages/react-scripts/template/README.md#debugging-tests-in-visual-studio-code
src/App.test.js
Debug
lens above the test.Expected Behavior
The debug overlay to open and the debugger to break.
Actual Behavior
Error: Cannot find jest.js file
Note: Following some research elsewhere on this issue queue and elsewhere I've also tried setting my
jest.pathToJest
in my.vscode/settings.json
to a number of different settings with no luck.Reference:
create-react-app #113
out-of-the-box unexpected token with create-react-app #125
out-of-the-box Visual Studio Code unexpected token when testing facebook/create-react-app#2709
Document how to debug unit tests facebook/create-react-app#594
https://stackoverflow.com/questions/47575916/vscode-says-it-cannot-find-jest-js-file
The text was updated successfully, but these errors were encountered: