Skip to content

Commit

Permalink
Add test for recommended configuration and rules metadata consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick Croissant committed Aug 14, 2016
1 parent 80e481e commit eb35605
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/index.js
Expand Up @@ -31,6 +31,16 @@ describe('configurations', function() {
var ruleName = configName.substring('react/'.length);
assert(plugin.rules[ruleName]);
});

ruleFiles.forEach(function(ruleName) {
var inRecommendedConfig = Boolean(plugin.configs.recommended.rules['react/' + ruleName]);
var isRecommended = plugin.rules[ruleName].meta.docs.recommended;
if (inRecommendedConfig) {
assert(isRecommended, ruleName + ' metadata should mark it as recommended');
} else {
assert(!isRecommended, ruleName + ' metadata should not mark it as recommended');
}
});
});
it('should export a \'all\' configuration', function() {
assert(plugin.configs.all);
Expand Down

0 comments on commit eb35605

Please sign in to comment.