I'm using Grunt, PhantomJS, and the "watch" plugin to run my QUnit tests while I develop (separate from CI). I'd like to be able to focus on a specific QUnit module while I'm working on the code that that module's tests are focused on. When running QUnit in the browser I can specify a module to run (versus all tests).
So the question is, can I tell the Grunt qunit task to only run a certain module? I'm thinking a command line argument so that I don't have to change my Gruntfile, something like:
~$ grunt qunit --module="test this stuff, test that stuff"
UPDATE
To be clear, what I want to run are modules created in a test suite using QUnit's 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 example above, this code is all in one test suite, but in the resulting html test file I get a drop down to run either module "group a" or module "group b" (through QUnit's UI). What I want is to be able to specify, programmatically, that I want to run a specific module through the grunt qunit
task.