JS-
JS-

Reputation: 957

Grunt grunt-contrib-jasmine

I have recently started to use grunt for JS project.

I have got a plugin called 'grunt-contrib-jasmine' that I'm using for Jasmine testing. I works great but I'm not able to run tests by specrunner in browser. Can I achieve this by using this plugin or do I need to install something else.

Also when a plugin is not required anymore, is it best to just comment it out or is there any command to uninstall, eg: npm uninstall grunt-contrib-jasmine --save-dev

Upvotes: 3

Views: 892

Answers (2)

Chris Jaynes
Chris Jaynes

Reputation: 2907

Just for clarification, you can load the _SpecRunner.html file manually in the browser, but the grunt plugin will only run the tests in PhantomJS.

You can specify the keepRunner:true option in your gruntfile to keep the _SpecRunner.html file around after the tests run.

Then you can start a static web server (grunt-contrib-connect, and node-static both work fine for me) to the root of your project, and you should be able to manually open that _SpecRunner.html in a browser and run your tests there.

EDIT: I ended up giving Testem a try, which can launch your tests in PhantomJS and real browsers. It's still early, but I think I'll be setting aside grunt-contrib-jasmine in favor of Testem and grunt-contrib-testem.

Upvotes: 4

RuntimeException
RuntimeException

Reputation: 1135

grunt-contrib-jasmine is only for headless browser (phantomjs) so I afraid you will not be able to run this in browser. You will need to set up that manually.

In order to uninstall a plugin, use the command you mentioned:

It will remove the entry from package.json and it'll also uninstall the package too.

Upvotes: 1

Related Questions