Andreas Selenwall
Andreas Selenwall

Reputation: 5785

How to run tests with gruntJS

So, how do I run the test suite in gruntjs? I thought it should be pretty simple and straight-forward but well, for me it wasn't :)

Since gruntjs should be able to run tests I thought that I could just run "grunt test", but that for some reason requires the server to run. I tried starting it in another process with "grunt server watch" but then again the "grunt test" fails.

How is grunt supposed to work?

Upvotes: 1

Views: 358

Answers (1)

Priya Ranjan Singh
Priya Ranjan Singh

Reputation: 1567

'grunt test' is a task that starts server too when required. It starts a test runner, for example karma and karma runs the tests in browser environment.

The trick is to run karma and provide configuration items in karma.conf.js

A sample gruntfile on gruntjs website shows how to make qUnit work with grunt.

Upvotes: 1

Related Questions