From 95bf8c391d325b6f77ff162cd8077c050cebe31c Mon Sep 17 00:00:00 2001 From: Justin Grant Date: Thu, 9 Sep 2021 17:13:09 -0700 Subject: [PATCH] Add VS Code config for IDE debugging of tests This commit adds a launch.json to enable easy IDE debugging of either Demitasse or (coming soon in #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. --- .gitignore | 3 ++- .npmignore | 1 + .vscode/launch.json | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .vscode/launch.json diff --git a/.gitignore b/.gitignore index 211717b7..d7c7c711 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ node_modules/ dist/ tsc-out/ .eslintcache -.vscode/ +.vscode/* +!.vscode/launch.json *.tgz diff --git a/.npmignore b/.npmignore index c5b178a4..77d4e578 100644 --- a/.npmignore +++ b/.npmignore @@ -3,3 +3,4 @@ test types tsconfig.json *.sh +.vscode diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..91f2dce2 --- /dev/null +++ b/.vscode/launch.json @@ -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" + }, + ] +} \ No newline at end of file