Skip to content

Commit 0d9dce0

Browse files
authored
chore: ensure that every rule has a .test.ts file in __tests__
1 parent 495c3e9 commit 0d9dce0

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/__tests__/rules.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ describe('rules', () => {
1818
});
1919
});
2020

21+
it('should have a corresponding test for each rule', () => {
22+
ruleNames.forEach(rule => {
23+
const testPath = resolve(
24+
__dirname,
25+
'../rules/__tests__/',
26+
`${rule}.test.ts`,
27+
);
28+
29+
if (!existsSync(testPath)) {
30+
throw new Error(
31+
`Could not find test file for rule "${rule}" in path "${testPath}"`,
32+
);
33+
}
34+
});
35+
});
36+
2137
it('should have the correct amount of rules', () => {
2238
const { length } = ruleNames;
2339
if (length !== numberOfRules) {

0 commit comments

Comments
 (0)