chore: Add launch.template.json for debugging tests (#9599)

This commit is contained in:
Nikolay Vitkov 2023-02-02 09:01:57 +01:00 committed by GitHub
parent f12f27e1eb
commit 25154c14d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 57 additions and 0 deletions

View File

@ -22,6 +22,8 @@ generated/
# IDE Artifacts # IDE Artifacts
.vscode .vscode
!.vscode/extensions.json
!.vscode/*.template.json
.devcontainer .devcontainer
# Misc # Misc

1
.gitignore vendored
View File

@ -22,6 +22,7 @@ generated/
# IDE Artifacts # IDE Artifacts
.vscode/* .vscode/*
!.vscode/extensions.json !.vscode/extensions.json
!.vscode/*.template.json
.devcontainer .devcontainer
# Misc # Misc

View File

@ -23,6 +23,7 @@ generated/
# IDE Artifacts # IDE Artifacts
.vscode/* .vscode/*
!.vscode/extensions.json !.vscode/extensions.json
!.vscode/*.template.json
.devcontainer .devcontainer
# Misc # Misc

43
.vscode/launch.template.json vendored Normal file
View File

@ -0,0 +1,43 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"inputs": [
{
"type": "pickString",
"id": "suit",
"description": "Which test suit to run?",
"options": [
"chrome-headless",
"chrome-headful",
"chrome-new-headless",
"firefox-headless",
"firefox-headful",
"firefox-bidi",
"chrome-bidi"
],
"default": "chrome-headless"
}
],
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Tests",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "npm",
"cwd": "${workspaceFolder}",
"runtimeArgs": [
"run-script",
"test",
"--",
"--test-suite",
"${input:suit}",
"--no-coverage",
"--no-suggestions"
],
"outFiles": ["${workspaceFolder}/**/*.js"]
}
]
}

View File

@ -264,6 +264,16 @@ ensure this, the main `test` command runs coverage during testing.
See [Debugging Tips](https://pptr.dev/guides/debugging). See [Debugging Tips](https://pptr.dev/guides/debugging).
### Debugging Puppeteer tests via VSCode
Copy the provided default `.vscode/launch.template.json` to `.vscode/launch.json` and then use the integrated VSCode debugger to debug test.
Remember to build test before launching via:
```sh
npm run build --workspace @puppeteer-test/test
```
# For Project Maintainers # For Project Maintainers
## Rolling new Chromium version ## Rolling new Chromium version