1.0.1 • Published 3 years ago

@kickstage/test-utils v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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();