Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 935 Bytes

no-empty-description.md

File metadata and controls

49 lines (32 loc) · 935 Bytes

Disallow empty test descriptions (mocha/no-empty-description)

💼 This rule is enabled in the ✅ recommended config.

This rule enforces you to specify the suite/test descriptions for each test.

Rule Details

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');
});

Options

Example of a custom rule configuration:

   rules: {
       "mocha/no-empty-description": [ "warn", {
           testNames: ["it", "specify", "test", "mytestname"],
           message: 'custom error message'
       } ]
   }