From aad6e44acdb090cc292dbf99871ef2ac6a856124 Mon Sep 17 00:00:00 2001 From: Justin Grote Date: Thu, 13 Apr 2023 20:18:45 -0700 Subject: [PATCH] Add environment variable indicating debug mode Fixes #239 --- src/core.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index 75977d1..4a39f40 100644 --- a/src/core.ts +++ b/src/core.ts @@ -277,7 +277,9 @@ export abstract class MochaAdapterCore { const execArgv = [ ...config.nodeArgv ]; if (debug && !config.launcherScript) { - execArgv.push(`--inspect-brk=${config.debuggerPort}`); + config.launcherScript + ? config.env.MOCHA_WORKER_DEBUG = true + : execArgv.push(`--inspect-brk=${config.debuggerPort}`); } this.runningTestProcess = this.launchWorkerProcess(config, childProcScript, execArgv);