Skip to content

Instantly share code, notes, and snippets.

@jsynowiec
Last active April 21, 2021 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jsynowiec/6a186ee14fa775ba73092eaa11af4983 to your computer and use it in GitHub Desktop.
Save jsynowiec/6a186ee14fa775ba73092eaa11af4983 to your computer and use it in GitHub Desktop.
[Jest config for debugging TypeScript tests in Visual Studio Code] #vscode #jest #typescript
{
"testEnvironment": "node",
"transform": {
"^.+\\.ts$": "ts-jest"
},
"moduleFileExtensions": [
"ts",
"js",
"json",
"node"
],
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(ts|js)$",
"coverageDirectory": "coverage",
"collectCoverageFrom": [
"src/**/*.{ts,js}",
"!src/**/*.d.ts"
]
}
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Jest Tests",
"cwd": "${workspaceFolder}",
"args": [
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
"--runInBand",
"--config",
"${workspaceRoot}/jest.config.json"
],
"windows": {
"args": [
"--inspect-brk",
"${workspaceRoot}/node_modules/jest/bin/jest.js",
"--runInBand"
"--config",
"${workspaceRoot}/jest.config.json"
],
},
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
]
}
@asashour
Copy link

There is missing comma at the end of line 23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment