5.0.1 • Published 4 months ago

eslint-ava-rule-tester v5.0.1

Weekly downloads
1,780
License
MIT
Repository
github
Last release
4 months ago

eslint-ava-rule-tester

ESLint's RuleTester for AVA

Allows you to run ESLint's RuleTester with AVA while still getting the nice report it provides by default.

Install

npm install --save-dev eslint-ava-rule-tester

Usage

Apart from how it is instantiated, the API is the same as ESLint's RuleTester. For information on how to test your rule, please follow the official documentation.

import test from 'ava';
import AvaRuleTester from 'eslint-ava-rule-tester';
import rule from '../rules/my-awesome-rule.js';

const ruleTester = new AvaRuleTester(test, {
  languageOptions: {
    ecmaVersion: 2024,
  },
});

ruleTester.run('my-awesome-rule', rule, {
  valid: [
    '...',
  ],
  invalid: [
    {
      code: 'console.lgo',
      errors: [{ message: 'console.log was mistyped', column: 1, line: 1 }],
      output: 'console.log', // Optional, use this when your rule fixes the errors
    },
  ],
});

Run ava --verbose to get a better overview of which tests failed.

License

MIT © Jeroen Engels

5.0.1

4 months ago

5.0.0

4 months ago

4.2.0

5 months ago

4.1.0

6 months ago

4.0.0

5 years ago

3.0.0

5 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago