Reputation: 1835
How can I run karma/jasmine tests? I set up a basic test within a .NET MVC app previously and I'm pretty sure I ran it and it passed but I'm forgetting how to load the runner for the test now.
UPDATE
Looks like package.json needs a "scripts" property with a "test" property.
My "test" property is configured to call "karma start ./karma.conf.js"
My package.json file has the following additional property:
"directories": { "test": "tests" },
My karma.conf.js has the following config setting:
files: [
'tests/*Spec.js'
],
However, when I exec cmd "npm test", the tests in my tests/BasicSpec.js file don't get loaded into the browser. Any idea what the issue might be?
Upvotes: 2
Views: 3884
Reputation: 9440
Do you have the two Chutzpah extensions installed?
Not sure why you need both, but you seem to.
Once they are installed, you can open the VS Unit Test Explorer, which should show your tests. Click the button to run the tests right inside Visual Studio.
Annoyingly, Jasmine pops up a web page with the results, which is pointless, as the test explorer shows them, and gives loads more functionality, but you can just close the web page and ignore it.
If that doesn't answer your question, please clarify what the problem is, and I'll change my answer.
Upvotes: 2