Selecting Tests to Run - J Query

When debugging a failing test, it can be a huge waste of time to rerun the entire test suite after every little change to your code just to see whether a single test now passes.


QUnit offers URL filtering to select the tests to run. This works best when combined with modules. You can run just the tests from a given module by appending a query string with the module name to the test suite URL. For example,
test.html?validation will run all tests in the module named validation:

You can combine tests from various modules by specifying multiple modules at once, delimited with the ampersand; e.g., test.html?validation&tooltip would run tests that contain validation or tooltip.
You can exclude tests using the exclamation mark; e.g., test.html?!validation would run all tests except those from the validation module.
Instead of manually modifying the URL, you can also double-click any of the test results to rerun just that test. QUnit will use the same filtering mechanism by appending the name of the test to the current location.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

J Query Topics