Skip to content

Commit

Permalink
test: add test for rule jsdoc type comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Nov 16, 2021
1 parent a3670e3 commit 2179743
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/package.mjs
Expand Up @@ -187,6 +187,16 @@ test('Every deprecated rules listed in docs/deprecated-rules.md', async t => {
}
});

test('Every rule file has the appropriate contents', t => {
for (const ruleFile of ruleFiles) {
const ruleName = path.basename(ruleFile, '.js');
const rulePath = path.join('rules', `${ruleName}.js`);
const ruleContents = fs.readFileSync(rulePath, 'utf8');

t.true(ruleContents.includes('/** @type {import(\'eslint\').Rule.RuleModule} */'), `${ruleName} includes jsdoc comment for rule type`);
}
});

test('Every rule has a doc with the appropriate content', t => {
for (const ruleFile of ruleFiles) {
const ruleName = path.basename(ruleFile, '.js');
Expand Down

0 comments on commit 2179743

Please sign in to comment.