Skip to content

Commit 927817f

Browse files
committed
Add debugging support to jest-runner
This adds debugging support to jest-runner for the integration tests when they are run from the `out` directory. Unfortunately, this removes the ability to debug the non-integration tests, such as the pure tests.
1 parent e60ed32 commit 927817f

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

.vscode/extensions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"amodio.tsl-problem-matcher",
77
"dbaeumer.vscode-eslint",
88
"esbenp.prettier-vscode",
9+
"firsttris.vscode-jest-runner",
910
"Orta.vscode-jest",
1011
],
1112
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
"LANG": "en-US",
4343
"TZ": "UTC"
4444
},
45+
"jestrunner.debugOptions": {
46+
"attachSimplePort": 9223,
47+
"env": {
48+
"VSCODE_WAIT_FOR_DEBUGGER": "true",
49+
}
50+
},
4551
"[typescript]": {
4652
"editor.defaultFormatter": "esbenp.prettier-vscode",
4753
"editor.formatOnSave": true,

extensions/ql-vscode/src/vscode-tests/jest-runner-vscode.config.base.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ const config = {
1717
};
1818

1919
if (process.env.VSCODE_INSPECTOR_OPTIONS) {
20-
config.launchArgs?.push("--inspect-extensions", "9223");
20+
if (process.env.VSCODE_WAIT_FOR_DEBUGGER === "true") {
21+
config.launchArgs?.push("--inspect-brk-extensions", "9223");
22+
} else {
23+
config.launchArgs?.push("--inspect-extensions", "9223");
24+
}
2125
}
2226

2327
module.exports = {

0 commit comments

Comments
 (0)