Add test to alert for rule replacements.

Eslint carries forward a replacement list that indicates when a
rule is about to be renamed/deprecated. This unit test checks our
rules against that list, and will fail if it detects a pending
replacement.

Change-Id: If1a20c2f6dd198f8ee9e38625977885e29f05303
This commit is contained in:
Michael Krotscheck 2015-08-28 09:43:57 -07:00
parent bf3239b331
commit 234f228f74
1 changed files with 12 additions and 0 deletions

View File

@ -20,6 +20,18 @@ describe("Unit: eslint-config-openstack", function() {
expect(config.env).toBeFalsy();
});
it("should alert on rule replacements.", function() {
var eslintReplacements = require('eslint/conf/replacements.json');
var rules = require('../index').rules;
/*eslint-disable guard-for-in */
for (var ruleName in eslintReplacements) {
expect(rules.hasOwnProperty(ruleName))
.toBeFalsy("Rule " + ruleName + " has been replaced:", eslintReplacements[ruleName]);
}
/*eslint-enable guard-for-in */
});
it("should only have opinions on rules that exist (no zombies).", function() {
var eslintRules = require('eslint/conf/eslint.json').rules;
var openstackRules = require('../index').rules;