Skip to content

Commit 603b4ac

Browse files
authored
chore(dev): Add VSCode debug profile for nextjs (#3554)
1 parent f880fda commit 603b4ac

File tree

1 file changed

+37
-12
lines changed

1 file changed

+37
-12
lines changed

.vscode/launch.json

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,52 @@
55
"version": "0.2.0",
66
// TODO: these are all alike save the package, so figure out how to make that variable
77
"configurations": [
8-
// @sentry/tracing - run a specific test file in watch mode
8+
9+
// @sentry/core - run a specific test file in watch mode
910
// must have file in currently active tab when hitting the play button
1011
{
1112
"type": "node",
1213
"request": "launch",
13-
"cwd": "${workspaceFolder}/packages/tracing",
14-
"name": "Debug @sentry/tracing tests - just open file",
14+
"cwd": "${workspaceFolder}/packages/core",
15+
"name": "Debug @sentry/core tests - just open file",
1516
"program": "${workspaceFolder}/node_modules/.bin/jest",
1617
"args": [
1718
"--watch",
1819
"--runInBand",
1920
"--config",
20-
"${workspaceFolder}/packages/tracing/package.json",
21+
"${workspaceFolder}/packages/core/package.json",
22+
"--coverage",
23+
"false", // coverage messes up the source maps
24+
"${relativeFile}" // remove this to run all package tests
25+
],
26+
"disableOptimisticBPs": true,
27+
"sourceMaps": true,
28+
"smartStep": true,
29+
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on "outputCapture" option here), but not both
30+
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
31+
},
32+
33+
// @sentry/nextjs - run a specific test file in watch mode
34+
// must have file in currently active tab when hitting the play button
35+
{
36+
"type": "node",
37+
"request": "launch",
38+
"cwd": "${workspaceFolder}/packages/nextjs",
39+
"name": "Debug @sentry/nextjs tests - just open file",
40+
"program": "${workspaceFolder}/node_modules/.bin/jest",
41+
"args": [
42+
"--watch",
43+
"--runInBand",
44+
"--config",
45+
"${workspaceFolder}/packages/nextjs/package.json",
2146
"--coverage",
2247
"false", // coverage messes up the source maps
2348
"${relativeFile}" // remove this to run all package tests
2449
],
2550
"disableOptimisticBPs": true,
2651
"sourceMaps": true,
2752
"smartStep": true,
28-
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which can't read from stdin
53+
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on "outputCapture" option here), but not both
2954
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
3055
},
3156

@@ -49,31 +74,31 @@
4974
"disableOptimisticBPs": true,
5075
"sourceMaps": true,
5176
"smartStep": true,
52-
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which can't read from stdin
77+
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on "outputCapture" option here), but not both
5378
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
5479
},
5580

56-
// @sentry/core - run a specific test file in watch mode
81+
// @sentry/tracing - run a specific test file in watch mode
5782
// must have file in currently active tab when hitting the play button
5883
{
5984
"type": "node",
6085
"request": "launch",
61-
"cwd": "${workspaceFolder}/packages/core",
62-
"name": "Debug @sentry/core tests - just open file",
86+
"cwd": "${workspaceFolder}/packages/tracing",
87+
"name": "Debug @sentry/tracing tests - just open file",
6388
"program": "${workspaceFolder}/node_modules/.bin/jest",
6489
"args": [
6590
"--watch",
6691
"--runInBand",
6792
"--config",
68-
"${workspaceFolder}/packages/core/package.json",
93+
"${workspaceFolder}/packages/tracing/package.json",
6994
"--coverage",
7095
"false", // coverage messes up the source maps
7196
"${relativeFile}" // remove this to run all package tests
7297
],
7398
"disableOptimisticBPs": true,
7499
"sourceMaps": true,
75100
"smartStep": true,
76-
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which can't read from stdin
101+
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on "outputCapture" option here), but not both
77102
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
78103
},
79104

@@ -97,7 +122,7 @@
97122
"disableOptimisticBPs": true,
98123
"sourceMaps": true,
99124
"smartStep": true,
100-
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which can't read from stdin
125+
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on "outputCapture" option here), but not both
101126
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
102127
},
103128
]

0 commit comments

Comments
 (0)