From 8d3e8c24597828db481c1d2539f484d431c8d730 Mon Sep 17 00:00:00 2001 From: juergba Date: Tue, 19 Feb 2019 15:06:09 +0100 Subject: [PATCH] adaption of existing tests --- .../skip-async-before-hooks.fixture.js | 3 +-- .../skip-async-before-nested.fixture.js | 3 +-- .../pending/skip-async-before.fixture.js | 2 +- .../pending/skip-async-beforeEach.fixture.js | 9 ++++---- .../pending/skip-async-spec.fixture.js | 2 +- test/integration/pending.spec.js | 23 +++++++++++-------- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/integration/fixtures/pending/skip-async-before-hooks.fixture.js b/test/integration/fixtures/pending/skip-async-before-hooks.fixture.js index 113fef5f8c..7afd6bc670 100644 --- a/test/integration/fixtures/pending/skip-async-before-hooks.fixture.js +++ b/test/integration/fixtures/pending/skip-async-before-hooks.fixture.js @@ -14,8 +14,7 @@ describe('outer suite', function () { console.log('inner before'); var self = this; setTimeout(function () { - self.skip(); - done(); + self.skip(); // done() is not required }, 0); }); diff --git a/test/integration/fixtures/pending/skip-async-before-nested.fixture.js b/test/integration/fixtures/pending/skip-async-before-nested.fixture.js index 8bab69c369..80a8e72bd5 100644 --- a/test/integration/fixtures/pending/skip-async-before-nested.fixture.js +++ b/test/integration/fixtures/pending/skip-async-before-nested.fixture.js @@ -2,8 +2,7 @@ describe('skip in before with nested describes', function () { before(function (done) { var self = this; setTimeout(function () { - self.skip(); - done(); + self.skip(); // done() is not required }, 0); }); diff --git a/test/integration/fixtures/pending/skip-async-before.fixture.js b/test/integration/fixtures/pending/skip-async-before.fixture.js index 5e47bf7bd9..992661299c 100644 --- a/test/integration/fixtures/pending/skip-async-before.fixture.js +++ b/test/integration/fixtures/pending/skip-async-before.fixture.js @@ -7,7 +7,7 @@ describe('outer describe', function () { before(function (done) { var self = this; setTimeout(function () { - self.skip(); + self.skip(); // done() is not required }, 0); }); diff --git a/test/integration/fixtures/pending/skip-async-beforeEach.fixture.js b/test/integration/fixtures/pending/skip-async-beforeEach.fixture.js index a4f4d24324..a450e44bdd 100644 --- a/test/integration/fixtures/pending/skip-async-beforeEach.fixture.js +++ b/test/integration/fixtures/pending/skip-async-beforeEach.fixture.js @@ -4,18 +4,17 @@ describe('skip in beforeEach', function () { beforeEach(function (done) { var self = this; setTimeout(function () { - self.skip(); - done(); + self.skip(); // done() is not required }, 0); }); - it('should skip this test', function () { + it('should skip this test-1', function () { throw new Error('never run this test'); }); - it('should not reach this test', function () { + it('should skip this test-2', function () { throw new Error('never run this test'); }); - it('should not reach this test', function () { + it('should skip this test-3', function () { throw new Error('never run this test'); }); }); diff --git a/test/integration/fixtures/pending/skip-async-spec.fixture.js b/test/integration/fixtures/pending/skip-async-spec.fixture.js index 00af28eadb..571ca5b851 100644 --- a/test/integration/fixtures/pending/skip-async-spec.fixture.js +++ b/test/integration/fixtures/pending/skip-async-spec.fixture.js @@ -4,7 +4,7 @@ describe('skip in test', function () { it('should skip async', function (done) { var self = this; setTimeout(function () { - self.skip(); + self.skip(); // done() is not required }, 0); }); diff --git a/test/integration/pending.spec.js b/test/integration/pending.spec.js index ea8bd4bf15..b6a7039201 100644 --- a/test/integration/pending.spec.js +++ b/test/integration/pending.spec.js @@ -258,18 +258,21 @@ describe('pending', function() { describe('in beforeEach', function() { it('should skip all suite specs', function(done) { - run('pending/skip-async-beforeEach.fixture.js', args, function( - err, - res - ) { + var fixture = 'pending/skip-async-beforeEach.fixture.js'; + run(fixture, args, function(err, res) { if (err) { - done(err); - return; + return done(err); } - assert.strictEqual(res.stats.pending, 1); - assert.strictEqual(res.stats.passes, 0); - assert.strictEqual(res.stats.failures, 1); - assert.strictEqual(res.code, 1); + expect(res, 'to have passed') + .and('to have passed test count', 0) + .and('to have pending test count', 3) + .and( + 'to have pending test order', + 'should skip this test-1', + 'should skip this test-2', + 'should skip this test-3' + ) + .and('to have failed test count', 0); done(); }); });