Skip to content

Commit 7e6d18f

Browse files
committed
Add launch config for running an e2e test
1 parent b0551d5 commit 7e6d18f

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.vscode/launch.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
"description": "Select the next command",
1717
"options": ["dev", "build", "start"],
1818
"default": "dev"
19+
},
20+
{
21+
"id": "nextTestMode",
22+
"type": "pickString",
23+
"description": "Select the next test mode",
24+
"options": ["dev", "start"],
25+
"default": "dev"
1926
}
2027
],
2128
"configurations": [
@@ -198,6 +205,28 @@
198205
"NEXT_TELEMETRY_DISABLED": "1"
199206
}
200207
},
208+
{
209+
"name": "Run e2e test",
210+
"type": "node",
211+
"request": "launch",
212+
"cwd": "${workspaceFolder}",
213+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/jest",
214+
"runtimeArgs": ["--runInBand", "--verbose", "${file}"],
215+
"console": "integratedTerminal",
216+
"skipFiles": ["<node_internals>/**"],
217+
"sourceMapPathOverrides": {
218+
"webpack://_N_E/[.]/(app|pages)/(.*)": "${workspaceFolder}/${fileDirname}/$1/$2",
219+
"webpack://_N_E/[.]/(.*)": "${workspaceFolder}/${fileDirname}/.next/server/$1",
220+
"webpack://_N_E/(?:../)*src/(.*)": "${workspaceFolder}/packages/next/src/$1",
221+
"webpack://next/./dist/src/*": "${workspaceFolder}/packages/next/src/*"
222+
},
223+
"env": {
224+
"HEADLESS": "true",
225+
"NEXT_E2E_TEST_TIMEOUT": "1000000",
226+
"NEXT_SKIP_ISOLATE": "1",
227+
"NEXT_TEST_MODE": "${input:nextTestMode}"
228+
}
229+
},
201230
{
202231
"name": "Launch app build trace jaeger",
203232
"type": "node",

contributing/core/vscode-debugger.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The common configurations are:
88

99
- **Launch app**: Run `next dev`, `next build`, or `next start` in a directory of your choice, with an attached debugger.
1010
- **Launch current directory**: Run `next dev`, `next build`, or `next start` in the directory of the currently active file, with an attached debugger.
11+
- **Run e2e test**: Run an e2e test using the currently active file, with an attached debugger.
1112

1213
### Run a specific app
1314

0 commit comments

Comments
 (0)