Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version:
Version: 1.100.0 (user setup)
Commit: 19e0f9e
Date: 2025-05-07T12:48:53.763Z
Electron: 34.5.1
ElectronBuildId: 11369351
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.19045
- OS Version:
Host OS:
Microsoft Windows [Version 10.0.19045.5737]
Guest OS:
WSL version: 2.3.26.0
Kernel version: 5.15.167.4-1
Ubuntu 20.04.6 LTS
Steps to Reproduce:
I am using Mocha to run javascript tests
In order to run a single test in a suite, mocha supports a "grep" syntax:
mocha --grep "Test Name"
My goal is to create a launch configuration in launch.json
which allows me to debug a specific test. To achieve this, I am using the ${input:...}
syntax in my launch.json
:
"configurations": [
{
"name": "Mocha Tests (Specific Test)",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/client/node_modules/mocha/bin/_mocha",
"args": [
"${workspaceFolder}/client/test",
"--no-timeouts",
"--colors",
"--grep",
"\"${input:pickTest}\""
],
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/**"
]
}
],
"inputs": [
{
"id": "pickTest",
"description": "Choose a test name",
"type": "promptString"
}
]
This does indeed execute the specific test based on the user input, however breakpoints do not trigger.
If I alter the args
to hard-code a specific test, the breakpoints do trigger. For example:
This works
"args": [
"${workspaceFolder}/client/test",
"--no-timeouts",
"--colors",
"--grep",
"\"Test Name\""
],
This does not work
"args": [
"${workspaceFolder}/client/test",
"--no-timeouts",
"--colors",
"--grep",
"\"${input:pickTest}\""
],
Is debugging supported when using promptString
? If so, is there a secret trick I'm missing?