Reputation: 764
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.
Upvotes: 18
Views: 8629
Reputation: 1840
The Test Explorer plugin will not show any test if an error is encountered. To check if there were any errors during the compilation of your tests, go to the Jasmine Explorer Log
in the Output tabs of VSCode (View -> Output)
You can see that in my case I was having an issue with module resolution that I fixed by tweaking tsconfig.json
.
Upvotes: 4
Reputation: 927
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
}
Upvotes: 10