Skip to content

Commit

Permalink
adaption of existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Feb 21, 2019
1 parent eb679b1 commit 8d3e8c2
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
Expand Up @@ -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);
});

Expand Down
Expand Up @@ -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);
});

Expand Down
Expand Up @@ -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);
});

Expand Down
Expand Up @@ -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');
});
});
Expand Up @@ -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);
});

Expand Down
23 changes: 13 additions & 10 deletions test/integration/pending.spec.js
Expand Up @@ -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();
});
});
Expand Down

0 comments on commit 8d3e8c2

Please sign in to comment.