Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* better assert messages

* sorting errors
  • Loading branch information...
commit d93d48f5980c57894278a65bc4df3b4f78bb6026 1 parent faa2d11
Julien Polo authored
Showing with 5 additions and 8 deletions.
  1. +2 −3 lib/assert/extension.js
  2. +2 −4 lib/lint/parser.js
  3. +1 −1  package.json
View
5 lib/assert/extension.js
@@ -6,7 +6,7 @@ if (! assert.validateLint) {
var result = lint.isValid(actual);
if (!result) {
- assert.fail(actual, true, message || "{actual} does not validate LINT", "===", assert.validateLint);
+ assert.fail(result, true, message || "LINT returned validation result {actual}", "===", assert.validateLint);
}
};
}
@@ -14,9 +14,8 @@ if (! assert.validateLint) {
if (! assert.validateLintFile) {
assert.validateLintFile = function (actual, message) {
var result = lint.isValidFileSync(actual);
-
if (!result) {
- assert.fail(actual, true, message || "{actual} file does not validate LINT", "===", assert.validateLintFile);
+ assert.fail(result, true, message || "LINT returned validation result {actual}", "===", assert.validateLintFile);
}
};
}
View
6 lib/lint/parser.js
@@ -171,14 +171,12 @@ Parser.prototype.validate = function (force) {
this._report = [];
errors = JSLINT.data().errors || [];
n = errors.length;
- while (n) {
+ while (n < errors.length) {
if (errors[n]) {
this._report.push(errors[n]);
}
- n -= 1;
+ n += 1;
}
-
- //this._report = JSLINT.data().errors || [];
this._isValid = (JSLINT.errors.length === 0);
}
return this;
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "lint",
"description": "This package provide lint validation library + node-lint command line tool allows you to check for problems using JSLint. You can specify your own --config file to use alternate JSLint options and your own --formatter file if you want to customize the generated output.",
- "version": "0.1.4",
+ "version": "0.1.7",
"homepage": "https://github.com/as-jpolo/node-lint",
"author": "tav <tav@espians.com> (http://tav.espians.com)",
"contributors": [
Please sign in to comment.
Something went wrong with that request. Please try again.