diff --git a/lib/mocha.js b/lib/mocha.js index c59b6d659a..c37f3c5dc8 100644 --- a/lib/mocha.js +++ b/lib/mocha.js @@ -487,10 +487,10 @@ Mocha.prototype.delay = function delay () { * Pending tests and test marked only or skip fail the suite * @returns {Mocha} */ - Mocha.prototype.productionMode = function() { - this.options.productionMode = true; - return this; - }; +Mocha.prototype.productionMode = function () { + this.options.productionMode = true; + return this; +}; /** * Run tests and invoke `fn()` when complete. diff --git a/lib/runner.js b/lib/runner.js index e810cc9928..47c2e2b2e3 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -824,9 +824,9 @@ Runner.prototype.run = function (fn) { var failures = self.failures; if (self.productionMode) { if (self.hasOnly) { - failures += self.stats.tests + failures += self.stats.tests; } else { - failures += self.stats.pending + failures += self.stats.pending; } } debug('end'); diff --git a/test/integration/fixtures/options/production/only.js b/test/integration/fixtures/options/production/only.js index 9ac9ca516c..23ba6bb70b 100644 --- a/test/integration/fixtures/options/production/only.js +++ b/test/integration/fixtures/options/production/only.js @@ -1,5 +1,5 @@ -describe('production mode - only', function() { - it('test1', function() {}); - it.only('stest2', function() {}); - it('test3', function() {}); +describe('production mode - only', function () { + it('test1', function () {}); + it.only('stest2', function () {}); + it('test3', function () {}); }); diff --git a/test/integration/fixtures/options/production/pending.js b/test/integration/fixtures/options/production/pending.js index 5d5d6105d4..41989cfc8f 100644 --- a/test/integration/fixtures/options/production/pending.js +++ b/test/integration/fixtures/options/production/pending.js @@ -1,5 +1,5 @@ -describe('production mode - pending', function() { - it('test1', function() {}); +describe('production mode - pending', function () { + it('test1', function () {}); it('test2'); - it('test3', function() {}); + it('test3', function () {}); }); diff --git a/test/integration/fixtures/options/production/skipped.js b/test/integration/fixtures/options/production/skipped.js index 8b7dc3d757..aafc510eaf 100644 --- a/test/integration/fixtures/options/production/skipped.js +++ b/test/integration/fixtures/options/production/skipped.js @@ -1,5 +1,5 @@ -describe('production mode - skipped', function() { - it('test1', function() {}); - it.skip('test2', function() {}); - it('test3', function() {}); +describe('production mode - skipped', function () { + it('test1', function () {}); + it.skip('test2', function () {}); + it('test3', function () {}); }); diff --git a/test/integration/options.spec.js b/test/integration/options.spec.js index cf47c5c83f..275842cdc7 100644 --- a/test/integration/options.spec.js +++ b/test/integration/options.spec.js @@ -181,31 +181,31 @@ describe('options', function () { }); }); - describe('--production', function() { - before(function() { + describe('--production', function () { + before(function () { args = ['--production']; }); - it('fails skipped tests', function(done) { - run('options/production/skipped.js', args, function(err, res) { + it('fails skipped tests', function (done) { + run('options/production/skipped.js', args, function (err, res) { assert(!err); - assert.equal(res.code, 1) + assert.equal(res.code, 1); done(); }); }); - it('fails pending tests', function(done) { - run('options/production/pending.js', args, function(err, res) { + it('fails pending tests', function (done) { + run('options/production/pending.js', args, function (err, res) { assert(!err); - assert.equal(res.code, 1) + assert.equal(res.code, 1); done(); }); }); - it('fails tests marked only', function(done) { - run('options/production/only.js', args, function(err, res) { + it('fails tests marked only', function (done) { + run('options/production/only.js', args, function (err, res) { assert(!err); - assert.equal(res.code, 1) + assert.equal(res.code, 1); done(); }); });