Skip to content

chore(dev): Add VSCode debug profile for nextjs #3554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 37 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,52 @@
"version": "0.2.0",
// TODO: these are all alike save the package, so figure out how to make that variable
"configurations": [
// @sentry/tracing - run a specific test file in watch mode

// @sentry/core - run a specific test file in watch mode
// must have file in currently active tab when hitting the play button
{
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/packages/tracing",
"name": "Debug @sentry/tracing tests - just open file",
"cwd": "${workspaceFolder}/packages/core",
"name": "Debug @sentry/core tests - just open file",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--watch",
"--runInBand",
"--config",
"${workspaceFolder}/packages/tracing/package.json",
"${workspaceFolder}/packages/core/package.json",
"--coverage",
"false", // coverage messes up the source maps
"${relativeFile}" // remove this to run all package tests
],
"disableOptimisticBPs": true,
"sourceMaps": true,
"smartStep": true,
"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
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
},

// @sentry/nextjs - run a specific test file in watch mode
// must have file in currently active tab when hitting the play button
{
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/packages/nextjs",
"name": "Debug @sentry/nextjs tests - just open file",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--watch",
"--runInBand",
"--config",
"${workspaceFolder}/packages/nextjs/package.json",
"--coverage",
"false", // coverage messes up the source maps
"${relativeFile}" // remove this to run all package tests
],
"disableOptimisticBPs": true,
"sourceMaps": true,
"smartStep": true,
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which can't read from stdin
"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
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
},

Expand All @@ -49,31 +74,31 @@
"disableOptimisticBPs": true,
"sourceMaps": true,
"smartStep": true,
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which can't read from stdin
"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
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
},

// @sentry/core - run a specific test file in watch mode
// @sentry/tracing - run a specific test file in watch mode
// must have file in currently active tab when hitting the play button
{
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/packages/core",
"name": "Debug @sentry/core tests - just open file",
"cwd": "${workspaceFolder}/packages/tracing",
"name": "Debug @sentry/tracing tests - just open file",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--watch",
"--runInBand",
"--config",
"${workspaceFolder}/packages/core/package.json",
"${workspaceFolder}/packages/tracing/package.json",
"--coverage",
"false", // coverage messes up the source maps
"${relativeFile}" // remove this to run all package tests
],
"disableOptimisticBPs": true,
"sourceMaps": true,
"smartStep": true,
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which can't read from stdin
"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
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
},

Expand All @@ -97,7 +122,7 @@
"disableOptimisticBPs": true,
"sourceMaps": true,
"smartStep": true,
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which can't read from stdin
"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
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
},
]
Expand Down