Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit eb028be

Browse files
authored
Add ability to debug Jest test from VSCode (#291)
thx to @diberry!
1 parent fee78a9 commit eb028be

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

.vscode/launch.json

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,43 @@
33
// Hover to view descriptions of existing attributes.
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
6-
"configurations": [
6+
"configurations": [
77
{
88
"type": "node",
99
"request": "attach",
1010
"name": "Attach by Process ID",
1111
"processId": "${command:PickProcess}",
1212
"protocol": "inspector"
13-
}
13+
},
14+
{
15+
"type": "node",
16+
"request": "launch",
17+
"name": "Jest Current File",
18+
"program": "${workspaceFolder}/node_modules/.bin/jest",
19+
"args": [
20+
"${fileBasenameNoExtension}",
21+
"--detectOpenHandles"
22+
],
23+
"console": "integratedTerminal",
24+
"internalConsoleOptions": "neverOpen",
25+
"disableOptimisticBPs": true,
26+
"windows": {
27+
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
28+
}
29+
},
30+
{
31+
"type": "node",
32+
"request": "launch",
33+
"name": "Jest all",
34+
"runtimeExecutable": "npm",
35+
"runtimeArgs": [
36+
"run-script",
37+
"test"
38+
],
39+
"port": 9229,
40+
"skipFiles": [
41+
"<node_internals>/**"
42+
]
43+
},
1444
]
1545
}

0 commit comments

Comments
 (0)