Skip to content

Instantly share code, notes, and snippets.

@aliustaoglu
Created January 29, 2018 21:31
Show Gist options
  • Save aliustaoglu/419826fc9467a936d1d3cbb97a4e8749 to your computer and use it in GitHub Desktop.
Save aliustaoglu/419826fc9467a936d1d3cbb97a4e8749 to your computer and use it in GitHub Desktop.
Debugging mocha tests with Visual Studio Code using TypeScript
{
// 3. important points
// My tests are located in /tests/ folder and they all have .spec.js extension
// sourceMaps are enabled because I am using TypeScript
// outFiles: My generated CommonJS files. They are located under /dist/ folder
"version": "0.2.0",
"configurations": [
{
"name": "Run mocha",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"stopOnEntry": false,
"args": ["tests/**/*.spec.js", "--no-timeouts"],
"cwd": "${workspaceRoot}",
"runtimeExecutable": null,
"env": { "NODE_ENV": "testing"}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment