Skip to content

Instantly share code, notes, and snippets.

@danyg
Last active October 24, 2022 09:33
Show Gist options
  • Save danyg/b1cd0ffc55c222cc8a781c55d763b818 to your computer and use it in GitHub Desktop.
Save danyg/b1cd0ffc55c222cc8a781c55d763b818 to your computer and use it in GitHub Desktop.
VSCode JEST debug current file
[
// USING jest for common configs
{
"type": "node",
"request": "launch",
"name": "Jest watch current test",
"cwd": "${workspaceFolder}",
"runtimeArgs": [
"--inspect",
"${workspaceRoot}/node_modules/.bin/jest",
"--runInBand", // necessary for typescript compilation cache propuses
"--watch",
"${relativeFile}" // will run current test file
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
// USING npm test for custom configurations
{
"name": "Jest watch current test",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"test",
"--runInBand", // necessary for typescript compilation cache propuses
"--watch",
"${relativeFile}" // will run current test file
],
"console": "integratedTerminal"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment