-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* @fileoverview Tests for eslint-all. | ||
* @author Alberto Rodríguez | ||
*/ | ||
|
||
"use strict"; | ||
|
||
//------------------------------------------------------------------------------ | ||
// Requirements | ||
//------------------------------------------------------------------------------ | ||
|
||
var assert = require("chai").assert, | ||
eslintAll = require("../../conf/eslint-all"), | ||
rules = eslintAll.rules; | ||
|
||
describe("eslint-all", function() { | ||
it("should only include rules", function() { | ||
var ruleNames = Object.keys(rules); | ||
|
||
assert.notInclude(ruleNames, ".eslintrc.yml"); | ||
|
||
}); | ||
|
||
it("should return all rules", function() { | ||
var ruleNames = Object.keys(rules); | ||
var count = ruleNames.length; | ||
var someRule = "yoda"; | ||
|
||
assert.include(ruleNames, someRule); | ||
assert.isAbove(count, 200); | ||
}); | ||
|
||
it("should configure all rules as errors", function() { | ||
var ruleNames = Object.keys(rules); | ||
var nonErrorRules = ruleNames.filter(function (ruleName) { | ||
return rules[ruleName] !== "error"; | ||
}); | ||
|
||
assert.equal(nonErrorRules.length, 0); | ||
}); | ||
}); |