Yes
Yes
Debug CRA Tests in VS Code
https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#debugging-tests-in-visual-studio-code
node -v: v8.9.1npm -v: 4.1.2yarn --version (if you use Yarn): No yarnnpm ls react-scripts (if you haven鈥檛 ejected): -- (empty)Then, specify:
Debug CRA Test launch configuration works on VSCode 1.19 (similar to VSCode 1.18).
No changes between VSCode versions, or an updated version of the documentation to setup the launch configuration.
The changelog for VSCode 1.19 mentions new additions on the debugging experience: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#debugging-tests-in-visual-studio-code
Issue created on VSCode: https://github.com/Microsoft/vscode/issues/40293
The VSCode team provided the correct configuration for launch.json. Apparently, the configuration documented on Create React App was working accidentaly due to a VS Code bug that was addressed on the latest version 1.19.
Here's the verified working code since VSCode 1.19, in case someone runs onto this. Let me know if you would like me to update the documentation (or if someone on the CRA team can do that).
{
"name": "Debug CRA Tests",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
"args": [
"test",
"--runInBand",
"--no-cache",
"--env=jsdom"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
Please send a pull request fixing our documentation! 馃槃
Does this still work? Noticed the update in the ReadMe today, was excited to try it out: only to have the debugger not stop at the breakpoints 馃槩
Does your environment match what's shown on the Issue description above?
If not: can you please post the environment settings that differ? E.g. VS Code version, node, etc.
Turned out I needed Node@v8+
Older project, so I had to bump my .nvmrc file
Most helpful comment
Turned out I needed Node@v8+
Older project, so I had to bump my .nvmrc file