Skip to content

Instantly share code, notes, and snippets.

@inigomarquinez
Created May 12, 2020 13:18
Show Gist options
  • Save inigomarquinez/061ad2fa66264d27f60fe5de31e911e0 to your computer and use it in GitHub Desktop.
Save inigomarquinez/061ad2fa66264d27f60fe5de31e911e0 to your computer and use it in GitHub Desktop.
How to configure Visual Studio Code for Jest test debugging
{
"version": "0.2.0",
"configurations": [
// Configuration used to debug the application (default configuration created by Visual Studio Code )
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/index.js"
},
// Configuration used to debug all the tests
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
}
},
// Configuration used to debug tests in the current file
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${fileBasenameNoExtension}",
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment