@kickstage/test-utils
v1.0.1
Published
A private package that exports utilities for testing eslint rules.
Downloads
2
Readme
test-utils
A private package that exports utilities for testing eslint rules.
- for each rule added to the config create a
__tests__/rule-name.test.js
file with tests for that rule:
import { test } from 'uvu';
import { getTester } from '@kickstage/test-utils';
const ruleName = 'some-rule-name';
const tester = getTester({
filePath: __filename,
eslintConfig: eslintConfig,
rule: ruleName,
});
test('should disallow ...', () => tester.invalid(`code`, ['Rule error message']));
test.run();