From 824a52cb6e9b5f2a307e7aaec538fa00fb9f807c Mon Sep 17 00:00:00 2001 From: juergba Date: Wed, 1 Jan 2020 10:18:13 +0100 Subject: [PATCH] adapt existing test --- .../pending/skip-sync-after.fixture.js | 3 +- test/integration/pending.spec.js | 35 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/test/integration/fixtures/pending/skip-sync-after.fixture.js b/test/integration/fixtures/pending/skip-sync-after.fixture.js index 45c6521f3c..8a2420619b 100644 --- a/test/integration/fixtures/pending/skip-sync-after.fixture.js +++ b/test/integration/fixtures/pending/skip-sync-after.fixture.js @@ -3,9 +3,8 @@ describe('skip in after', function () { it('should run this test-1', function () {}); - after('should print DeprecationWarning', function () { + after('should throw "this.skip forbidden"', function () { this.skip(); - throw new Error('never throws this error'); }); describe('inner suite', function () { diff --git a/test/integration/pending.spec.js b/test/integration/pending.spec.js index 3232fb0805..7179ff187b 100644 --- a/test/integration/pending.spec.js +++ b/test/integration/pending.spec.js @@ -73,24 +73,23 @@ describe('pending', function() { }); describe('in after', function() { - it('should run all tests', function(done) { - runMocha( - 'pending/skip-sync-after.fixture.js', - args, - function(err, res) { - if (err) { - return done(err); - } - expect(res, 'to have passed').and('to satisfy', { - passing: 3, - failing: 0, - pending: 0, - output: expect.it('to contain', '"after all" hook is DEPRECATED') - }); - done(); - }, - 'pipe' - ); + it('should throw, but run all tests', function(done) { + run('pending/skip-sync-after.fixture.js', args, function(err, res) { + if (err) { + return done(err); + } + expect(res, 'to have failed with error', '`this.skip` forbidden') + .and('to have failed test count', 1) + .and('to have pending test count', 0) + .and('to have passed test count', 3) + .and( + 'to have passed test order', + 'should run this test-1', + 'should run this test-2', + 'should run this test-3' + ); + done(); + }); }); });