Skip to content

Commit

Permalink
Added a test verifying exported name is correct (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
DCzajkowski authored Jul 19, 2019
1 parent 368fb35 commit 395b821
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/verify-correct-rules-declarations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { rules, failingRules, readmeEntries } from './helpers';
import test from 'tape';
import { namespace } from '../src/constants';

test('all rules have required files', t => {
t.plan(rules.length);
Expand Down Expand Up @@ -35,3 +36,17 @@ test('all rules have their entry in the readme', t => {
);
});
});

test('all rules export correct name', t => {
t.plan(rules.length);

rules.forEach(({ name }) => {
const { ruleName } = require(`../src/rules/${name}`);

t.equals(
ruleName,
`${namespace}/${name}`,
`Exported rule name from the rule '${name}' matches '${namespace}/${name}'`,
);
});
});

0 comments on commit 395b821

Please sign in to comment.