💼 This rule is enabled in the ✅ recommended
config.
This rule prevents from incorrect usage of Nested Scope. Developer can write nested test instead of nested module by mistake. In this case test will still be executed, but effects may be unexpected.
The following patterns are considered warnings:
QUnit.test('Parent', function () {
QUnit.test('Child', function () {});
});
test('Parent', function () {
test('Child', function () {});
});
QUnit.test('ParentTest', function () {
QUnit.module('ChildModule', function () {
QUnit.test('ChildTest', function () {});
});
});
The following patterns are not considered warnings:
QUnit.test('First', function () {});
QUnit.test('Second', function () {});
QUnit.module('ParentModule', function () {
QUnit.test('Parent', function () {});
QUnit.module('ChildModule', function () {
QUnit.test('ChildTest', function () {});
});
});
It should be safe to use this rule. However it may cause false positive when using same namespace test
during act or arrange stages.