Skip to content

Commit

Permalink
test: Add test for rule jsdoc type comment (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Nov 17, 2021
1 parent de1e2f0 commit 3568bc4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/lib/rule-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ describe('rule setup is correct', () => {
const ALLOWED_CATEGORIES = ['Rules', 'Tests'];
assert.ok(ALLOWED_CATEGORIES.includes(rule.meta.docs.category), 'has an allowed category');
});

it('should have the right contents', () => {
const filePath = path.join(__dirname, '..', '..', 'lib', 'rules', `${ruleName}.js`);
const file = readFileSync(filePath, 'utf8');

assert.ok(
file.includes("/** @type {import('eslint').Rule.RuleModule} */"),
'includes jsdoc comment for rule type'
);
});
});
}
});
Expand Down

0 comments on commit 3568bc4

Please sign in to comment.