I use Grunt, PhantomJS and the watch plugin to run QUnit tests during development (separate from CI). I would like to focus on a specific QUnit module while I work on the code that those unit tests focus on. When running QUnit in a browser, I can specify the module to run (compared to all tests).
So the question is, can I ask the Grunt qunit task only to run a specific module? I think the command line argument, so I do not need to change my Gruntfile, something like:
~$ grunt qunit --module="test this stuff, test that stuff"
UPDATE
To be clear, I want to run modules created in a test suite using the QUnit module() method:
module( "group a" ); test( "a basic test example", function() { ok( true, "this test is fine" ); }); test( "a basic test example 2", function() { ok( true, "this test is fine" ); }); module( "group b" ); test( "a basic test example 3", function() { ok( true, "this test is fine" ); }); test( "a basic test example 4", function() { ok( true, "this test is fine" ); });
In the above example, this code is in one test suite, but in the resulting html test file I get a drop-down list to run either the "group a" module or the "group b" module (via the QUnit interface). I want to programmatically indicate that I want to run a specific module using the grunt qunit .
source share