Skip to content

Commit

Permalink
adapt existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Oct 25, 2019
1 parent 8f15f4d commit b72c5af
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/integration/fixtures/uncaught.fixture.js
Expand Up @@ -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);
Expand Down
10 changes: 7 additions & 3 deletions test/integration/uncaught.spec.js
Expand Up @@ -32,17 +32,21 @@ 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,
'fails exactly once when a global error is thrown first'
);
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();
});
});
Expand Down
8 changes: 4 additions & 4 deletions test/unit/runner.spec.js
Expand Up @@ -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');
});
});

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

Expand Down

0 comments on commit b72c5af

Please sign in to comment.