Skip to content

Rule: prefer output: null to assert that a test case is not autofixed #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
not-an-aardvark opened this issue Jul 16, 2017 · 0 comments · Fixed by #20
Closed

Rule: prefer output: null to assert that a test case is not autofixed #19

not-an-aardvark opened this issue Jul 16, 2017 · 0 comments · Fixed by #20

Comments

@not-an-aardvark
Copy link
Contributor

Disallows invalid RuleTester test cases with the output the same as the code.

Invalid:

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

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

Valid:

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

new RuleTester().run('foo', rule, {
  valid: [],
  invalid: [
    {
      code: 'foo',
      output: null,
      errors: 1
    }
  ]
});
/* eslint eslint-plugin/prefer-output-null: error */

new RuleTester().run('foo', rule, {
  valid: [],
  invalid: [
    {
      code: 'foo',
      output: 'bar',
      errors: 1
    }
  ]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants