From fa8b4192dac013fe90e96e5dab85695e94d33643 Mon Sep 17 00:00:00 2001 From: Andrew Twyman Date: Fri, 14 Jun 2024 18:22:41 -0700 Subject: [PATCH 1/2] Debug config for tests in current file --- .vscode/launch.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index 4eef458919..6202fa94f3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,23 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "args": [ + "-r", + "ts-node/register", + "--config", + "${workspaceFolder}/.mocharc.js", + "--no-timeouts", + "--exit", + "${file}" + ], + "cwd": "${fileDirname}", + "internalConsoleOptions": "openOnSessionStart", + "name": "TS Mocha Test (Current File)", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "request": "launch", + "type": "node" + }, { "type": "node", "request": "attach", From fcdc3673f8530800a8e4209cad4e0adc6c51e35b Mon Sep 17 00:00:00 2001 From: Andrew Twyman Date: Mon, 17 Jun 2024 18:45:48 -0700 Subject: [PATCH 2/2] Alternative config for discussion --- .vscode/launch.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index 6202fa94f3..6e984a5f2b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -21,6 +21,21 @@ "request": "launch", "type": "node" }, + { + "args": [ + "--config", + "${workspaceFolder}/.mocharc.js", + "--no-timeouts", + "--exit", + "${file}" + ], + "cwd": "${fileDirname}/../../../..", + "internalConsoleOptions": "openOnSessionStart", + "name": "TS Mocha Alternative (with fixed CWD path)", + "program": "${workspaceFolder}/node_modules/ts-mocha/bin/ts-mocha", + "request": "launch", + "type": "node" + }, { "type": "node", "request": "attach",