mocha-sidebar
mocha-sidebar copied to clipboard
[Typescript] "Run test at cursor" command fails with "Mocha is only available for JavaScript files."
Description
In a typescript project, Run test at cursor
command fails with this notification message: "Mocha is only available for JavaScript files."
Steps to Reproduce
- Open a .spec.ts file
- Place cursor on a test
- Run the command with: Ctrl+Shift+P > "Mocha: Run test at cursor"
Expected Results
No error message and the test should run.
Actual Results
The notification message "Mocha is only available for JavaScript files." is shown and the test is not run.
Note: If I manually change the "Language Mode" to "JavaScript", it works, even if the file still contains typescript code!
Settings file
"mocha.files.glob": "**/*.spec.ts",
"mocha.options": {
"config": "packages/services/my-api/.mocharc.unit.js"
},
"mocha.env": {
"NODE_ENV": "test"
},
"mocha.requires": ["ts-node/register"],
Versions
- VScode: v1.82.0
- Mocha SideBar: v0.22.2
- Node Version: v18.15.0
OS version
- [X] Linux
- [ ] Mac
- [ ] Windows