Reputation: 25413
When running qUnit tests in the browser you can run a specific test by clicking on the "Rerun" button.
This will result in a hash identifier for that test to be added as a value to the testId
url param and only that test will be run. The only API function is another way of accomplishing this.
But, often times I want to run a couple tests, say, tests 5 through 8.
Is there a way to run a sub-set of tests on a page...or at least a way of referencing these tests with an index, rather than a hash?
Upvotes: 0
Views: 330
Reputation: 2645
There are several options how you could group several tests.
On the right top of the page there is a Filter, so if several tests have word "myTest" in their test name, you could apply this word to the filter, press go and only tests which have this word in the test name will be run.
If you add the following code, then you will get additional module of tests which means that all the tests which are after this module definition until another module definition or end of file will be run.
QUnit.module("Test with datetime", {});
Inside the object {}
you could also write your setup
and teardown
methods.
More information for Qunit moduling you could find here.
Upvotes: 1