|
51 | 51 |
|
52 | 52 |
|
53 | 53 | // @sentry/nextjs - Run a specific integration test file |
54 | | - // Must have file in currently active tab when hitting the play button |
| 54 | + // Must have test file in currently active tab when hitting the play button, and must already have run `yarn` in test app directory |
55 | 55 | { |
56 | 56 | "name": "Debug @sentry/nextjs integration tests - just open file", |
57 | 57 | "type": "node", |
58 | 58 | "cwd": "${workspaceFolder}/packages/nextjs", |
59 | 59 | "request": "launch", |
60 | | - // TODO create a build task |
61 | | - // "preLaunchTask": "yarn build", |
62 | | - |
63 | | - // this is going straight to `server.js` (rather than running the tests through yarn) in order to be able to skip |
64 | | - // having to reinstall dependencies on every new test run |
| 60 | + // since we're not using the normal test runner, we need to make sure we're using the current version of all local |
| 61 | + // SDK packages and then manually rebuild the test app |
| 62 | + "preLaunchTask": "Prepare nextjs integration test app for debugging", |
| 63 | + // running `server.js` directly (rather than running the tests through yarn) allows us to skip having to reinstall |
| 64 | + // dependencies on every new test run |
65 | 65 | "program": "${workspaceFolder}/packages/nextjs/test/integration/test/server.js", |
66 | 66 | "args": [ |
67 | 67 | "--debug", |
68 | 68 | // remove these two lines to run all integration tests |
69 | 69 | "--filter", |
70 | 70 | "${fileBasename}" |
71 | 71 | ], |
72 | | - "sourceMaps": true, |
| 72 | + |
73 | 73 | "skipFiles": [ |
74 | | - "<node_internals>/**", "**/tslib/**" |
| 74 | + "<node_internals>/**", |
| 75 | + // this prevents us from landing in a neverending cycle of TS async-polyfill functions as we're stepping through |
| 76 | + // our code |
| 77 | + "${workspaceFolder}/node_modules/tslib/**/*" |
75 | 78 | ], |
| 79 | + "sourceMaps": true, |
| 80 | + // this controls which files are sourcemapped |
| 81 | + "outFiles": [ |
| 82 | + // our SDK code |
| 83 | + "${workspaceFolder}/**/dist/**/*.js", |
| 84 | + // the built test app |
| 85 | + "${workspaceFolder}/packages/nextjs/test/integration/.next/**/*.js", |
| 86 | + "!**/node_modules/**" |
| 87 | + ], |
| 88 | + "resolveSourceMapLocations": [ |
| 89 | + "${workspaceFolder}/**/dist/**", |
| 90 | + "${workspaceFolder}/packages/nextjs/test/integration/.next/**", |
| 91 | + "!**/node_modules/**" |
| 92 | + ], |
| 93 | + "internalConsoleOptions": "openOnSessionStart" |
| 94 | + |
76 | 95 | }, |
77 | 96 | ] |
78 | 97 | } |
0 commit comments