Skip to content

Instantly share code, notes, and snippets.

@natterstefan
Last active October 17, 2023 18:26
Show Gist options
  • Save natterstefan/a20f5fc808a2955fbc208cb144367002 to your computer and use it in GitHub Desktop.
Save natterstefan/a20f5fc808a2955fbc208cb144367002 to your computer and use it in GitHub Desktop.
VSCode | Debug tests in Create-React-App (all or single file)
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug CRA Tests",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
"args": ["test", "--runInBand", "--no-cache", "--watchAll=false"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"env": { "CI": "true" },
"disableOptimisticBPs": true
},
{
"name": "Debug CRA Current File",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
"args": [
"test",
"--runInBand",
"--no-cache",
"--watchAll=false",
"${fileBasenameNoExtension}"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"env": { "CI": "true" },
"disableOptimisticBPs": true
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment