💼 This rule is enabled in the ✅ recommended
config.
When developing non-trivial projects, it is unfortunately realistic that unit tests may need to be temporarily prevented from running until an upstream problem is fixed. However, in that case, the test should be disabled in a way that allows QUnit (and your team) to be aware that it is disabled, so that it may be re-enabled later on.
QUnit provides the QUnit.skip()
function to mark a test as skipped. This
should be preferred over commenting out the test. A commented out unit test
will not show up in any reporter, but a skipped test will appear in all
reporters.
The following patterns are considered warnings:
// QUnit.test("Name", function () { ok(true); });
// QUnit.asyncTest("Name", function () { ok(true); });
// test("Name", function () { ok(true); });
// asyncTest("Name", function () { ok(true); });
The following patterns are not considered warnings:
QUnit.skip("Name", function () { ok(true); });
It is best to enable this rule. However, if you don't care about tests being left in a disabled state in perpetuity, or if it would be too much trouble to change all existing commented out tests, then this rule can be safely disabled.