Skip to content

Commit 3568bc4

Browse files
authored
test: Add test for rule jsdoc type comment (#229)
1 parent de1e2f0 commit 3568bc4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/lib/rule-setup.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ describe('rule setup is correct', () => {
7070
const ALLOWED_CATEGORIES = ['Rules', 'Tests'];
7171
assert.ok(ALLOWED_CATEGORIES.includes(rule.meta.docs.category), 'has an allowed category');
7272
});
73+
74+
it('should have the right contents', () => {
75+
const filePath = path.join(__dirname, '..', '..', 'lib', 'rules', `${ruleName}.js`);
76+
const file = readFileSync(filePath, 'utf8');
77+
78+
assert.ok(
79+
file.includes("/** @type {import('eslint').Rule.RuleModule} */"),
80+
'includes jsdoc comment for rule type'
81+
);
82+
});
7383
});
7484
}
7585
});

0 commit comments

Comments
 (0)