💼 This rule is enabled in the ✅ recommended
config.
This rule enforces you to specify the suite/test descriptions for each test.
This rule checks each mocha test function to have a non-empty description.
The following patterns are considered problems:
it();
suite('');
test(function () {});
test.only(' ', function () {});
These patterns would not be considered problems:
describe('foo', function () {
it('bar');
});
suite('foo', function () {
test('bar');
});
Example of a custom rule configuration:
rules: {
"mocha/no-empty-description": [ "warn", {
testNames: ["it", "specify", "test", "mytestname"],
message: 'custom error message'
} ]
}