Skip to content

armgit / mocha

Public Imported from GitHub
0

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

style(*): indentation, etc.

Ariel Mashraki9123d7ae6310
diff --git a/lib/mocha.js b/lib/mocha.js
index 4795d82f..61febc1d 100644
--- a/lib/mocha.js
+++ b/lib/mocha.js
@@ -82,7 +82,7 @@ function Mocha(options) {
this.bail(options.bail);
this.reporter(options.reporter, options.reporterOptions);
if (null != options.timeout) this.timeout(options.timeout);
- this.useColors(options.useColors)
+ this.useColors(options.useColors);
if (options.enableTimeouts !== null) this.enableTimeouts(options.enableTimeouts);
if (options.slow) this.slow(options.slow);
@@ -141,8 +141,8 @@ Mocha.prototype.reporter = function(reporter, reporterOptions){
} else {
reporter = reporter || 'spec';
var _reporter;
- try { _reporter = require('./reporters/' + reporter); } catch (err) {};
- if (!_reporter) try { _reporter = require(reporter); } catch (err) {};
+ try { _reporter = require('./reporters/' + reporter); } catch (err) {}
+ if (!_reporter) try { _reporter = require(reporter); } catch (err) {}
if (!_reporter && reporter === 'teamcity')
console.warn('The Teamcity reporter was moved to a package named ' +
'mocha-teamcity-reporter ' +
@@ -164,7 +164,7 @@ Mocha.prototype.reporter = function(reporter, reporterOptions){
Mocha.prototype.ui = function(name){
name = name || 'bdd';
this._ui = exports.interfaces[name];
- if (!this._ui) try { this._ui = require(name); } catch (err) {};
+ if (!this._ui) try { this._ui = require(name); } catch (err) {}
if (!this._ui) throw new Error('invalid interface "' + name + '"');
this._ui = this._ui(this.suite);
return this;
diff --git a/lib/runner.js b/lib/runner.js
index 634c4b28..79118969 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -695,20 +695,20 @@ function filterLeaks(ok, globals) {
* @api private
*/
- function extraGlobals() {
- if (typeof(process) === 'object' &&
- typeof(process.version) === 'string') {
+function extraGlobals() {
+ if (typeof(process) === 'object' &&
+ typeof(process.version) === 'string') {
- var nodeVersion = process.version.split('.').reduce(function(a, v) {
- return a << 8 | v;
- });
-
- // 'errno' was renamed to process._errno in v0.9.11.
+ var nodeVersion = process.version.split('.').reduce(function(a, v) {
+ return a << 8 | v;
+ });
- if (nodeVersion < 0x00090B) {
- return ['errno'];
- }
- }
+ // 'errno' was renamed to process._errno in v0.9.11.
- return [];
+ if (nodeVersion < 0x00090B) {
+ return ['errno'];
+ }
}
+
+ return [];
+}
diff --git a/mocha.js b/mocha.js
index 82f1c0bf..e355cd9d 100644
--- a/mocha.js
+++ b/mocha.js
@@ -1486,7 +1486,7 @@ function Mocha(options) {
this.bail(options.bail);
this.reporter(options.reporter, options.reporterOptions);
if (null != options.timeout) this.timeout(options.timeout);
- this.useColors(options.useColors)
+ this.useColors(options.useColors);
if (options.enableTimeouts !== null) this.enableTimeouts(options.enableTimeouts);
if (options.slow) this.slow(options.slow);
@@ -1545,8 +1545,8 @@ Mocha.prototype.reporter = function(reporter, reporterOptions){
} else {
reporter = reporter || 'spec';
var _reporter;
- try { _reporter = require('./reporters/' + reporter); } catch (err) {};
- if (!_reporter) try { _reporter = require(reporter); } catch (err) {};
+ try { _reporter = require('./reporters/' + reporter); } catch (err) {}
+ if (!_reporter) try { _reporter = require(reporter); } catch (err) {}
if (!_reporter && reporter === 'teamcity')
console.warn('The Teamcity reporter was moved to a package named ' +
'mocha-teamcity-reporter ' +
@@ -1568,7 +1568,7 @@ Mocha.prototype.reporter = function(reporter, reporterOptions){
Mocha.prototype.ui = function(name){
name = name || 'bdd';
this._ui = exports.interfaces[name];
- if (!this._ui) try { this._ui = require(name); } catch (err) {};
+ if (!this._ui) try { this._ui = require(name); } catch (err) {}
if (!this._ui) throw new Error('invalid interface "' + name + '"');
this._ui = this._ui(this.suite);
return this;
@@ -5249,24 +5249,24 @@ function filterLeaks(ok, globals) {
* @api private
*/
- function extraGlobals() {
- if (typeof(process) === 'object' &&
- typeof(process.version) === 'string') {
+function extraGlobals() {
+ if (typeof(process) === 'object' &&
+ typeof(process.version) === 'string') {
- var nodeVersion = process.version.split('.').reduce(function(a, v) {
- return a << 8 | v;
- });
-
- // 'errno' was renamed to process._errno in v0.9.11.
+ var nodeVersion = process.version.split('.').reduce(function(a, v) {
+ return a << 8 | v;
+ });
- if (nodeVersion < 0x00090B) {
- return ['errno'];
- }
- }
+ // 'errno' was renamed to process._errno in v0.9.11.
- return [];
+ if (nodeVersion < 0x00090B) {
+ return ['errno'];
+ }
}
+ return [];
+}
+
}); // module: runner.js
require.register("suite.js", function(module, exports, require){