Для самых последних create-react-app
(2.1.5) и react-scripts-ts
(3.1.0) создайте каталог .vscode
в корне вашего проекта и добавьте следующий launch.json
:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug CRA Tests",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts-ts",
"args": [
"test",
"--runInBand",
"--no-cache",
"--no-watch",
"--env=jsdom"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
Затем запустите отладчик VSCode, используя конфигурацию Debug CRA Tests
.