mocha-jshint
Advanced tools
Comparing version 0.0.1 to 0.0.2
26
index.js
var jsHint = require("./node_modules/jshint/src/cli.js"); | ||
module.exports = function (paths) { | ||
paths = paths || ['.']; | ||
paths.forEach(function (p) { | ||
var options = { | ||
args: [p], | ||
reporter: require('./reporter.js') | ||
}; | ||
jsHint.run(options); | ||
describe("JSHint", function () { | ||
paths = paths || ['.']; | ||
paths.forEach(function (p) { | ||
it("should pass for " + (p === '.' ? 'working directory' : p), function () { | ||
var error = new Error(''); | ||
error.message = ''; | ||
error.stack = ''; | ||
var options = { | ||
args: [p], | ||
reporter: require('./reporter.js')(error) | ||
}; | ||
jsHint.run(options); | ||
if (error.message) { | ||
throw error; | ||
} | ||
}); | ||
}); | ||
}); | ||
}; | ||
}; |
{ | ||
"name": "mocha-jshint", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "run JSHint as mocha tests", | ||
@@ -20,3 +20,13 @@ "main": "index.js", | ||
"jshint": "~2.3" | ||
}, | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/Muscula/mocha-jshint.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Muscula/mocha-jshint/issues" | ||
} | ||
} |
@@ -22,2 +22,7 @@ mocha-jshint | ||
To grep only the JSHint test, just do | ||
``` | ||
mocha --grep JSHint | ||
``` | ||
Why? | ||
@@ -24,0 +29,0 @@ --- |
var path = require('path'); | ||
module.exports = function (results) { | ||
results.forEach(function (result) { | ||
var file = result.file; | ||
var error = result.error; | ||
describe("JSHint of file " + file, function () { | ||
it("should pass", function () { | ||
var err = new Error("JSHint error: " + error.reason); | ||
err.stack = ' at (' + path.resolve(file) + ':' + error.line + ':' + error.character + ')'; | ||
throw err; | ||
}); | ||
module.exports = function (err) { | ||
return function (results) { | ||
results.forEach(function (result) { | ||
var file = result.file; | ||
var error = result.error; | ||
if (err.message) { | ||
err.message += '\n'; | ||
err.stack += '\n'; | ||
} | ||
err.message += "JSHint error: " + error.reason + ' ' + file + ':' + error.line + ':' + error.character; | ||
err.stack += error.reason + '\n at (' + path.resolve(file) + ':' + error.line + ':' + error.character + ')'; | ||
}); | ||
}); | ||
if (results.length === 0) { | ||
describe("JSHint", function () { | ||
it("should pass", function () { | ||
}); | ||
}); | ||
} | ||
}; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
11770
35
1
34
0