Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jasmine test explorer not showing test cases(it blocks) list in jasmine test explorer in visual studio code

I am using Visual Studio code, Protractor, Typescript and Jasmine framework. I have spec test cases within "it" block.

To see all the test cases or it blocks I have installed "Jasmine Test Explorer " and "Jasmine Explorer UI" but somehow test cases are not listed.

Could you please help me to resolve this.

enter image description here

like image 670
simond Avatar asked Jun 26 '18 11:06

simond


People also ask

How do I enable test Explorer in Visual Studio?

If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer (or press Ctrl + E, T). As you run, write, and rerun your tests, the Test Explorer displays the results in a default grouping of Project, Namespace, and Class.


1 Answers

Here is a possible solution:

Create a setting pointing to your config file (e.g. in .vscode/settings.json):

{
  "jasmineExplorer.config": "jasmine.json",
  ...
}

In the jasmine.json file, you tell the explorer where the specifications are. Here is an example:

{
    "spec_dir": "site/dist/tests",
    "spec_files": ["**/*[sS]pec.js"],
    "helpers": ["helpers/**/*.js"],
    "random": false,
    "seed": null,
    "stopSpecOnExpectationFailure": false
}
like image 92
Willem Avatar answered Sep 24 '22 00:09

Willem