diff --git a/test/integration/fixtures/uncaught.fixture.js b/test/integration/fixtures/uncaught/double.fixture.js similarity index 100% rename from test/integration/fixtures/uncaught.fixture.js rename to test/integration/fixtures/uncaught/double.fixture.js diff --git a/test/integration/fixtures/uncaught-fatal.fixture.js b/test/integration/fixtures/uncaught/fatal.fixture.js similarity index 100% rename from test/integration/fixtures/uncaught-fatal.fixture.js rename to test/integration/fixtures/uncaught/fatal.fixture.js diff --git a/test/integration/fixtures/uncaught-hook.fixture.js b/test/integration/fixtures/uncaught/hook.fixture.js similarity index 100% rename from test/integration/fixtures/uncaught-hook.fixture.js rename to test/integration/fixtures/uncaught/hook.fixture.js diff --git a/test/integration/fixtures/regression/issue-1327.fixture.js b/test/integration/fixtures/uncaught/issue-1327.fixture.js similarity index 100% rename from test/integration/fixtures/regression/issue-1327.fixture.js rename to test/integration/fixtures/uncaught/issue-1327.fixture.js diff --git a/test/integration/fixtures/regression/issue-1417.fixture.js b/test/integration/fixtures/uncaught/issue-1417.fixture.js similarity index 100% rename from test/integration/fixtures/regression/issue-1417.fixture.js rename to test/integration/fixtures/uncaught/issue-1417.fixture.js diff --git a/test/integration/fixtures/uncaught-pending.fixture.js b/test/integration/fixtures/uncaught/pending.fixture.js similarity index 100% rename from test/integration/fixtures/uncaught-pending.fixture.js rename to test/integration/fixtures/uncaught/pending.fixture.js diff --git a/test/integration/regression.spec.js b/test/integration/regression.spec.js index 0682cdc353..0cf644e6b3 100644 --- a/test/integration/regression.spec.js +++ b/test/integration/regression.spec.js @@ -4,21 +4,6 @@ var run = require('./helpers').runMocha; var runJSON = require('./helpers').runMochaJSON; describe('regressions', function() { - it('issue-1327: should run the first test and then bail', function(done) { - var args = []; - runJSON('regression/issue-1327.fixture.js', args, function(err, res) { - if (err) { - return done(err); - } - expect(res, 'to have failed') - .and('to have passed test count', 1) - .and('to have failed test count', 1) - .and('to have passed test', 'test 1') - .and('to have failed test', 'test 1'); - done(); - }); - }); - it('issue-1991: Declarations do not get cleaned up unless you set them to `null` - Memory Leak', function(done) { // on a modern MBP takes ±5 seconds on node 4.0, but on older laptops with node 0.12 ±40 seconds. // Could easily take longer on even weaker machines (Travis-CI containers for example). @@ -90,22 +75,4 @@ describe('regressions', function() { done(); }); }); - - it('issue-1417 uncaught exceptions from async specs', function(done) { - runJSON('regression/issue-1417.fixture.js', [], function(err, res) { - if (err) { - done(err); - return; - } - expect(res, 'to have failed with errors', 'sync error a', 'sync error b') - .and('to have exit code', 2) - .and('not to have passed tests') - .and('not to have pending tests') - .and('to have failed test order', [ - 'fails exactly once when a global error is thrown synchronously and done errors', - 'fails exactly once when a global error is thrown synchronously and done completes' - ]); - done(); - }); - }); }); diff --git a/test/integration/uncaught.spec.js b/test/integration/uncaught.spec.js index 7d673b1eaa..c088f8ba92 100644 --- a/test/integration/uncaught.spec.js +++ b/test/integration/uncaught.spec.js @@ -1,12 +1,13 @@ 'use strict'; var assert = require('assert'); -var run = require('./helpers').runMochaJSON; +var helpers = require('./helpers'); +var run = helpers.runMochaJSON; var args = []; describe('uncaught exceptions', function() { it('handles uncaught exceptions from hooks', function(done) { - run('uncaught-hook.fixture.js', args, function(err, res) { + run('uncaught/hook.fixture.js', args, function(err, res) { if (err) { done(err); return; @@ -25,7 +26,7 @@ describe('uncaught exceptions', function() { }); it('handles uncaught exceptions from async specs', function(done) { - run('uncaught.fixture.js', args, function(err, res) { + run('uncaught/double.fixture.js', args, function(err, res) { if (err) { done(err); return; @@ -48,7 +49,7 @@ describe('uncaught exceptions', function() { }); it('handles uncaught exceptions from which Mocha cannot recover', function(done) { - run('uncaught-fatal.fixture.js', args, function(err, res) { + run('uncaught/fatal.fixture.js', args, function(err, res) { if (err) { return done(err); } @@ -65,7 +66,7 @@ describe('uncaught exceptions', function() { }); it('handles uncaught exceptions within pending tests', function(done) { - run('uncaught-pending.fixture.js', args, function(err, res) { + run('uncaught/pending.fixture.js', args, function(err, res) { if (err) { return done(err); } @@ -98,4 +99,35 @@ describe('uncaught exceptions', function() { done(); }); }); + + it('issue-1327: should run the first test and then bail', function(done) { + run('uncaught/issue-1327.fixture.js', args, function(err, res) { + if (err) { + return done(err); + } + expect(res, 'to have failed') + .and('to have passed test count', 1) + .and('to have failed test count', 1) + .and('to have passed test', 'test 1') + .and('to have failed test', 'test 1'); + done(); + }); + }); + + it('issue-1417: uncaught exceptions from async specs', function(done) { + run('uncaught/issue-1417.fixture.js', args, function(err, res) { + if (err) { + return done(err); + } + expect(res, 'to have failed with errors', 'sync error a', 'sync error b') + .and('to have exit code', 2) + .and('not to have passed tests') + .and('not to have pending tests') + .and('to have failed test order', [ + 'fails exactly once when a global error is thrown synchronously and done errors', + 'fails exactly once when a global error is thrown synchronously and done completes' + ]); + done(); + }); + }); });