Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Fix eqeqeq linting errors from eslint 1.4.0 release

Daniel St. Julesfb3fe33fbb5d
diff --git a/lib/mocha.js b/lib/mocha.js
index e3a2321e..eb6c8d07 100644
--- a/lib/mocha.js
+++ b/lib/mocha.js
@@ -85,7 +85,7 @@ function Mocha(options) {
this.ui(options.ui);
this.bail(options.bail);
this.reporter(options.reporter, options.reporterOptions);
- if (options.timeout != null) {
+ if (typeof options.timeout !== 'undefined' && options.timeout !== null) {
this.timeout(options.timeout);
}
this.useColors(options.useColors);
diff --git a/lib/reporters/base.js b/lib/reporters/base.js
index 6bac3e04..7939a20c 100644
--- a/lib/reporters/base.js
+++ b/lib/reporters/base.js
@@ -401,7 +401,7 @@ function unifiedDiff(err, escape) {
return indent + line;
}
function notBlank(line) {
- return line != null;
+ return typeof line !== 'undefined' && line !== null;
}
var msg = diff.createPatch('string', err.actual, err.expected);
var lines = msg.split('\n').splice(4);