Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 723 Bytes

prefer-output-null.md

File metadata and controls

31 lines (23 loc) · 723 Bytes

Disallows invalid RuleTester test cases with the output the same as the code. (prefer-output-null)

Rule Details

The rule reports an error if it encounters a test case where the output is the same as the code.

Examples of incorrect code for this rule:

/* eslint eslint-plugin/prefer-output-null: error */

new RuleTester().run('foo', bar, {
    valid: [],
    invalid: [
      { code: 'foo', output: 'foo', errors: [{ message: 'bar' }] },
    ]
});

Examples of correct code for this rule:

/* eslint eslint-plugin/prefer-output-null: error */

new RuleTester().run('foo', bar, {
    valid: [],
    invalid: [
      { code: 'foo', output: null, errors: [{ message: 'bar' }] },
    ]
});