Skip to content

Commit

Permalink
chore: ensure that every rule has a .test.ts file in __tests__
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed May 5, 2020
1 parent 495c3e9 commit 0d9dce0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/__tests__/rules.test.ts
Expand Up @@ -18,6 +18,22 @@ describe('rules', () => {
});
});

it('should have a corresponding test for each rule', () => {
ruleNames.forEach(rule => {
const testPath = resolve(
__dirname,
'../rules/__tests__/',
`${rule}.test.ts`,
);

if (!existsSync(testPath)) {
throw new Error(
`Could not find test file for rule "${rule}" in path "${testPath}"`,
);
}
});
});

it('should have the correct amount of rules', () => {
const { length } = ruleNames;
if (length !== numberOfRules) {
Expand Down

0 comments on commit 0d9dce0

Please sign in to comment.