Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mocha sidebar is not showing tests

I'm developing a very simple typescript project and I added a very tiny test with mocha. I installed mocha sidebar on VS Code and all it's dependencies, but test are not showing in the left panel.

The strange is that when I press debug button, my test run without problem (?)

I want to distribute this package on NPM, and only distribute .js, .d.ts, js.map and d.ts.map files.

I think the problem is in my project.json, but I cannot figure what is it. The source code is here

like image 911
Vladimir Venegas Avatar asked Sep 29 '18 16:09

Vladimir Venegas


People also ask

Do Mocha tests run sequentially?

Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. Hosted on GitHub.


2 Answers

The only change I needed was in the VS code workspace settings: Under extensions I pointed the 'mocha glob files'-setting to my test scripts

like image 123
Arjan Avatar answered Sep 28 '22 09:09

Arjan


One thing that I notice from your repo is you have package.json, test folder and another src folder inside type-exception/src.

I can run the mocha sidebar plugin successfully.

My solution is to open the project in vscode from the type-exception/src folder not type-exception folder.

My file structure

enter image description here

My mocha sidebar

enter image description here

I also saw that you have correct vscode workspace settings that set mocha files to

{
    "mocha.files.glob": "lib/test/**/*.js"
}

Hope it helps

like image 32
deerawan Avatar answered Sep 28 '22 09:09

deerawan