From b72c5af39032ff44bc9ff9c2df9f86d77cc322e0 Mon Sep 17 00:00:00 2001 From: juergba Date: Fri, 25 Oct 2019 14:59:20 +0200 Subject: [PATCH] adapt existing tests --- test/integration/fixtures/uncaught.fixture.js | 2 +- test/integration/uncaught.spec.js | 10 +++++++--- test/unit/runner.spec.js | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/test/integration/fixtures/uncaught.fixture.js b/test/integration/fixtures/uncaught.fixture.js index 6a2ded880c..c793bb6824 100644 --- a/test/integration/fixtures/uncaught.fixture.js +++ b/test/integration/fixtures/uncaught.fixture.js @@ -11,7 +11,7 @@ it('fails exactly once when a global error is thrown first', function (done) { }, 0); }); -it('fails exactly once when a global error is thrown second', function (done) { +it('fails twice when a global error is thrown second', function (done) { setTimeout(function () { done(new Error('test error')); }, 0); diff --git a/test/integration/uncaught.spec.js b/test/integration/uncaught.spec.js index a65c4b5097..fa931c7962 100644 --- a/test/integration/uncaught.spec.js +++ b/test/integration/uncaught.spec.js @@ -32,7 +32,7 @@ describe('uncaught exceptions', function() { } assert.strictEqual(res.stats.pending, 0); assert.strictEqual(res.stats.passes, 0); - assert.strictEqual(res.stats.failures, 2); + assert.strictEqual(res.stats.failures, 3); assert.strictEqual( res.failures[0].title, @@ -40,9 +40,13 @@ describe('uncaught exceptions', function() { ); assert.strictEqual( res.failures[1].title, - 'fails exactly once when a global error is thrown second' + 'fails twice when a global error is thrown second' ); - assert.strictEqual(res.code, 2); + assert.strictEqual( + res.failures[2].title, + 'fails twice when a global error is thrown second' + ); + assert.strictEqual(res.code, 3); done(); }); }); diff --git a/test/unit/runner.spec.js b/test/unit/runner.spec.js index 67043a98bb..b3bf02c253 100644 --- a/test/unit/runner.spec.js +++ b/test/unit/runner.spec.js @@ -800,9 +800,9 @@ describe('Runner', function() { sandbox.stub(runnable, 'isFailed').returns(true); }); - it('should not attempt to fail again', function() { + it('should attempt to fail again', function() { runner.uncaught(err); - expect(runner.fail, 'was not called'); + expect(runner.fail, 'was called once'); }); }); @@ -811,9 +811,9 @@ describe('Runner', function() { sandbox.stub(runnable, 'isPending').returns(true); }); - it('should not attempt to fail', function() { + it('should attempt to fail', function() { runner.uncaught(err); - expect(runner.fail, 'was not called'); + expect(runner.fail, 'was called once'); }); });