Skip to content

Instantly share code, notes, and snippets.

@tonyhallett
Created March 26, 2019 14:23
Show Gist options
  • Save tonyhallett/e1b36e479028a737ad92d0103dca2809 to your computer and use it in GitHub Desktop.
Save tonyhallett/e1b36e479028a737ad92d0103dca2809 to your computer and use it in GitHub Desktop.
vscode launch.json for jest debugging
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "vscode-jest-tests",
"request": "launch",
"args": [
"--runInBand",
"--coverage", "false"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
{
"type": "node",
"name": "vscode-jest-tests selected text",
"request": "launch",
"args": [
"--runInBand",
"--testNamePattern",
"${selectedText}",
"--coverage", "false",
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
{
"type": "node",
"name": "vscode-jest-tests prompt pattern",
"request": "launch",
"args": [
"--runInBand",
"--testNamePattern",
"${input:jestSpecificTest}",
"--coverage", "false",
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
,
{
"type": "node",
"name": "vscode-jest-tests current file",
"request": "launch",
"args": [
"--runInBand",
"--coverage", "false",
"--runTestsByPath",
"${relativeFile}",
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}],
"inputs": [
{
"id": "jestSpecificTest",
"type": "promptString",
"description":"testNamePattern"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment