diff --git a/src/commands/runTest.ts b/src/commands/runTest.ts index 670ef85..8120d25 100644 --- a/src/commands/runTest.ts +++ b/src/commands/runTest.ts @@ -32,9 +32,19 @@ function getExistingLaunchConfig( "launch", args.workspaceFolder, ); - const testConfig = launchJson.configurations.findLast( - (e: { name: string }) => e.name === "mix test", + const configurations = launchJson.get( + "configurations", ); + let testConfig: vscode.DebugConfiguration | undefined; + if (Array.isArray(configurations)) { + for (let i = configurations.length - 1; i >= 0; i--) { + const c = configurations[i]; + if (c?.name === "mix test") { + testConfig = c; + break; + } + } + } if (testConfig === undefined) { return undefined;