Skip to content

Commit

Permalink
Add VS Code config for IDE debugging of tests
Browse files Browse the repository at this point in the history
This commit adds a launch.json to enable easy IDE debugging of either
Demitasse or (coming soon in js-temporal#41) Test262 tests.

For Test262, there are two different configs:
1) Only debug the subset of tests shown in launch.json. Edit launch.json
   to debug other tests. Warning: commenting out the TESTS env var
   will debug all tests but that will take 10+ mins to run.
2) Only debug the test file currently open in the editor.
  • Loading branch information
justingrant committed Sep 10, 2021
1 parent bafa1bd commit 95bf8c3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ node_modules/
dist/
tsc-out/
.eslintcache
.vscode/
.vscode/*
!.vscode/launch.json
*.tgz
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ test
types
tsconfig.json
*.sh
.vscode
38 changes: 38 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "npm run test262",
"name": "Test262 (files in launch.json)",
"request": "launch",
"type": "node-terminal",
"env": {
// Replace the glob pattern below with tests you want to debug. Comment
// out to run all tests, but will be very slow!
"TESTS": "PlainYearMonth/prototype/subtract/*.js",
// Extends timeouts to 1 hour (from 10 seconds default) so you can
// debug a test stopped at a breakpoint before the runner kills it.
"TIMEOUT": "3600000"
}
},
{
"command": "npm run test262",
"name": "Test262 (current file)",
"request": "launch",
"type": "node-terminal",
"env": {
// Only test the currently-opened file in the IDE
"TESTS": "${file}",
// Extends timeouts to 1 hour (from 10 seconds default) so you can
// debug a test stopped at a breakpoint before the runner kills it.
"TIMEOUT": "3600000"
}
},
{
"command": "npm test",
"name": "Demitasse tests",
"request": "launch",
"type": "node-terminal"
},
]
}

0 comments on commit 95bf8c3

Please sign in to comment.