mocha-sidebar: Cannot run mocha-sidebar with typescript ts-node
Hi there,
I’m just trying out this package. But when I try to run the tests using mocha sidebar it just doesn’t read show my tests.
In the output tab I get this Finding tests with Mocha on Node.js at “/usr/bin/node” And I also get the error Mocha sidebar: Process exited with code 1. See Mocha output for more info.
My workspace settings look like this:
"mocha.files.glob": "src/**/*.spec.ts", "mocha.options": { "compilers": { "ts": "ts-node/register" } }, "mocha.requires": [ "ts-node/register" ], "mocha.runTestsOnSave": "true"
I have typescript installed locally I have all my unit tests under src directory.
Is there any docs I can refer to for Typescript setup with ts-node?
Thanks Ahmad
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 41 (15 by maintainers)
hi @ahmadkhudeish
It works for me with these settings:
"mocha.options": { "compilers": "ts-node/register" }, "mocha.requires": [ "ts-node/register" ], "mocha.files.glob": "test/*.test.ts"
i just uninstall, and reintall it , it work! this is my config
Hello, How can I solve this problem? https://stackoverflow.com/q/68004071/1817640
@maty21
"ts-node": "^7.0.0",
Additionally, I removed the options section from the settings so all I have left is:
{ "mocha.files.glob": "**/*.spec.ts", "mocha.requires": [ "ts-node/register" ], }
Uninstalled and reinstalled the sidebar but still nothing. Sorry.
Do my best to fix it for you guys in this week
On Tue, Jul 17, 2018, 5:47 AM sparky.dasrath notifications@github.com wrote:
It took me a while but I got it running.
I have no idea what was wrong, actually, but in the end my config is:
I think what did the trick was no specifying the directory in mocha.files.glob, instead, going directly with the recursion.
@PandaWood you can see the test result in the output if you set mocha.logVerbous to true in the settings