From eb3560524824a10b060c50d2e9deb55c1afa9996 Mon Sep 17 00:00:00 2001 From: Yannick Croissant Date: Sun, 14 Aug 2016 14:35:55 +0200 Subject: [PATCH] Add test for recommended configuration and rules metadata consistency --- tests/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/index.js b/tests/index.js index c9d0664760..a85b4cb6f2 100644 --- a/tests/index.js +++ b/tests/index.js @@ -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);