Skip to content

Commit 5a76a6c

Browse files
committed
Add "Debug Node test" launch configs
1 parent 843b69b commit 5a76a6c

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

.github/DEVELOPMENT.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,16 @@ debug.
153153

154154
² Requires at least WebStorm 2025.2 EAP
155155

156+
### Attach debugger to Node.js from a test
157+
158+
Run configurations for VS Code and WebStorm are set up in the repo.
159+
160+
- Optionally set a breakpoint anywhere in source or test code
161+
- From any test file, run the "Debug Node test" run configuration
162+
163+
From now on, just hit `F5` (Code) or `ctrl-r` (WS) from any test file to run and
164+
debug.
165+
156166
### Attach debugger to tests
157167

158168
In case you're wondering if or why some code is ever hit, attach the debugger to

.idea/runConfigurations/Debug_Node_test.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vscode/launch.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
"runtimeArgs": ["test", "--timeout", "999999999"],
1212
"internalConsoleOptions": "openOnSessionStart"
1313
},
14+
{
15+
"type": "node",
16+
"request": "launch",
17+
"name": "Debug Node test",
18+
"program": "${workspaceFolder}/node_modules/.bin/tsx",
19+
"args": ["--test", "--import", "./transform-test.js", "${file}"],
20+
"cwd": "${workspaceFolder}/packages/knip",
21+
"console": "integratedTerminal",
22+
"internalConsoleOptions": "openOnSessionStart"
23+
},
1424
{
1525
"type": "bun",
1626
"request": "attach",

0 commit comments

Comments
 (0)