Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mocha-jshint

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-jshint - npm Package Compare versions

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 () {
});
});
}
};
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc