vscode
vscode copied to clipboard
Debugging a test fails if the name contains parentheses
Describe the bug If my test name contains parentheses, such as "myMethod() returns false", running the test works but debugging it fails. The reason for that is due to the extension making the following command line call:
node .\node_modules\vitest\vitest.mjs add.test.ts -t "add()"
The -t option accept a test pattern, indicating I believe a regular expression. Parentheses are special characters in a regular expression, and since this extension isn't escaping them the match fails. It should be doing -t "add\(\)" instead.
To Reproduce Steps to reproduce the behavior on the example project:
- Rename "add" test to "add()"
- Debug it.
Expected behavior Test is run in debug mode and breakpoints are hit.
Screenshots
No test files found, exiting with code 1
Environment
- OS: Windows
- VSCode version: 1.71.2
- Vitest version: 0.23.2
- Vitest plugin version: 0.2.29