Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 1.33 KB

no-pending-tests.md

File metadata and controls

37 lines (23 loc) · 1.33 KB

Disallow pending tests (mocha/no-pending-tests)

⚠️ This rule warns in the ✅ recommended config.

Mocha allows specification of pending tests, which represent tests that aren't yet implemented, but are intended to be implemented eventually. These are designated like a normal mocha test, but with only the first argument provided (no callback for the actual implementation). For example: it('unimplemented test');

This rule allows you to raise ESLint warnings or errors on pending tests. This can be useful, for example, for reminding developers that pending tests exist in the repository, so they're more likely to get implemented.

Rule Details

This rule looks for it, test, and specify function calls with only one argument, where the argument is a string literal.

The following patterns are considered warnings:

it('foo');
specify('foo');
test('foo');

These patterns are not considered warnings:

it('foo', function () {});
specify('foo', function () {});
test('foo', function () {});

When Not To Use It

  • If the existence of pending/unimplemented tests isn't considered important enough to warrant raising lint warnings/errors.

Further Reading