🔧 This rule is automatically fixable by the --fix CLI option.
QUnit tests can be difficult to debug without useful module and test names. The purpose of this rule is to ensure that module and test names are present and valid.
The following patterns are considered warnings:
// Missing names
module(function () {});
test(function () {});
// Empty or space-only names
module("", function () {});
test("", function () {});
module(" ", function () {});
test(" ", function () {});
// Leading and trailing spaces
module(' Foo Bar unit ', function () {});
test(' it does foo ', function () {});
// Non-string names
module(["foo"], function () {});
test(["foo"], function () {});
module(1, function () {});
test(1, function () {});
// Names starting or ending with QUnit delimiters (>, :)
module('>Foo Bar unit', function () {});
test('>it does foo', function () {});
module('Foo Bar unit>', function () {});
test('it does foo>', function () {});
module(':Foo Bar unit', function () {});
test(':it does foo', function () {});
module('Foo Bar unit:', function () {});
test('it does foo:', function () {});The following patterns are not considered warnings:
// Valid strings
module("Foo Bar", function () {});
test("Foo Bar", function () {});
// Templates are okay since those are strings
module(`Foo Bar ${foo}`, function () {});
test(`Foo Bar ${foo}`, function () {});
// Can't check variables
module(foo, function () {});
test(foo, function () {});This rule is mostly stylistic, but can cause problems in the case of QUnit delimiters at the start and end of test names.