Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save inigomarquinez/ffb2c79d5bfd4aec51c6358efb0a87aa to your computer and use it in GitHub Desktop.
Save inigomarquinez/ffb2c79d5bfd4aec51c6358efb0a87aa to your computer and use it in GitHub Desktop.
How to configure Visual Studio Code for Mocha 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 within 'test' folder
{
"type": "node",
"request": "launch",
"name": "Mocha All within 'test' folder",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
// Configuration used to debug all the tests matching '*.test.js' regular expression
// (mocha configuration file)
{
"type": "node",
"request": "launch",
"name": "Mocha configuration file",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--config",
"${workspaceFolder}/.my-mocha-config.json",
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
// Configuration used to debug tests in the current file
{
"type": "node",
"request": "launch",
"name": "Mocha Current File",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${file}"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment