Skip to content

Commit

Permalink
chore: Add launch.template.json for debugging tests (puppeteer#9599)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade authored Feb 2, 2023
1 parent f12f27e commit 25154c1
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ generated/

# IDE Artifacts
.vscode
!.vscode/extensions.json
!.vscode/*.template.json
.devcontainer

# Misc
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ generated/
# IDE Artifacts
.vscode/*
!.vscode/extensions.json
!.vscode/*.template.json
.devcontainer

# Misc
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ generated/
# IDE Artifacts
.vscode/*
!.vscode/extensions.json
!.vscode/*.template.json
.devcontainer

# Misc
Expand Down
43 changes: 43 additions & 0 deletions .vscode/launch.template.json
Original file line number Diff line number Diff line change
@@ -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"]
}
]
}
10 changes: 10 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,16 @@ ensure this, the main `test` command runs coverage during testing.

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

## Rolling new Chromium version
Expand Down

0 comments on commit 25154c1

Please sign in to comment.