eslint-tester
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -0,1 +1,9 @@ | ||
v0.5.0 - January 10, 2015 | ||
* 0.5.0 (Nicholas C. Zakas) | ||
* New: Add options option (fixes #15) (Nicholas C. Zakas) | ||
* Update: Add ecmaFeatures support (fixes #14) (Nicholas C. Zakas) | ||
* Upgrade: dev dependencies (Nicholas C. Zakas) | ||
* 0.4.0 (Nicholas C. Zakas) | ||
v0.4.0 - December 23, 2014 | ||
@@ -2,0 +10,0 @@ |
@@ -83,4 +83,4 @@ /** | ||
var config = { rules: {} }, | ||
code = item.code ? item.code : item, | ||
filename; | ||
code = item.code ? item.code : item, | ||
filename; | ||
@@ -95,6 +95,17 @@ if (item.globals || item.global) { | ||
if (item.ecmaFeatures) { | ||
config.ecmaFeatures = item.ecmaFeatures; | ||
} | ||
config.settings = item.settings; | ||
config.rules[ruleName] = item.args ? item.args : 1; | ||
if (item.options) { | ||
var options = item.options.concat(); | ||
options.unshift(1); | ||
config.rules[ruleName] = options; | ||
} else { | ||
config.rules[ruleName] = item.args ? item.args : 1; | ||
} | ||
eslint.defineRule(ruleName, require(path.resolve(process.cwd(), rulePath))); | ||
@@ -101,0 +112,0 @@ return eslint.verify(code, config, filename); |
{ | ||
"name": "eslint-tester", | ||
"author": "Nicholas C. Zakas", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "A testing utility for ESLint", | ||
@@ -21,11 +21,11 @@ "repository": "eslint/eslint-tester", | ||
"dependencies": { | ||
"chai": "~1.8.1", | ||
"chai": "^1.10.0", | ||
"mocha": "~1.17.1" | ||
}, | ||
"devDependencies": { | ||
"shelljs": "~0.2.6", | ||
"dateformat": "~1.0.7-1.2.3", | ||
"rewire": "~2.0.0", | ||
"istanbul": "~0.2.4", | ||
"eslint": "latest" | ||
"dateformat": "^1.0.11", | ||
"eslint": "latest", | ||
"istanbul": "^0.3.5", | ||
"rewire": "^2.1.3", | ||
"shelljs": "^0.3.0" | ||
}, | ||
@@ -32,0 +32,0 @@ "engines": { |
@@ -297,3 +297,3 @@ /** | ||
code: "var foo = 'bar'", | ||
filename: 'somefile.js' | ||
filename: "somefile.js" | ||
} | ||
@@ -313,2 +313,24 @@ ], | ||
it("should pass-through the options to the rule", function() { | ||
assert.doesNotThrow(function() { | ||
eslintTester.addRuleTest("tests/fixtures/no-invalid-args", { | ||
valid: [ | ||
{ | ||
code: "var foo = 'bar'", | ||
options: [ false ] | ||
} | ||
], | ||
invalid: [ | ||
{ | ||
code: "var foo = 'bar'", | ||
options: [ true ], | ||
errors: [ { message: "Invalid args" } ] | ||
} | ||
] | ||
}); | ||
}); | ||
}); | ||
it("should throw an error if there are no valid tests", function() { | ||
@@ -315,0 +337,0 @@ |
31423
671
+ Addedchai@1.10.0(transitive)
- Removedchai@1.8.1(transitive)
Updatedchai@^1.10.0