Skip to content

Commit

Permalink
test for #2303
Browse files Browse the repository at this point in the history
  • Loading branch information
dima117 committed Jun 14, 2016
1 parent 5e5eac5 commit 46654cd
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,17 @@ describe('Runner', function(){
});

describe('allowUncaught', function() {
var immediately;

before(function() {
immediately = Runner.immediately;
Runner.immediately = function(fn) { fn(); };
});

after(function() {
Runner.immediately = immediately;
});

it('should allow unhandled errors to propagate through', function(done) {
var newRunner = new Runner(suite);
newRunner.allowUncaught = true;
Expand All @@ -327,6 +338,19 @@ describe('Runner', function(){
fail.should.throw('allow unhandled errors');
done();
});

it('should allow unhandled errors in hooks to propagate through', function(done) {
var runner = new Runner(suite);
runner.allowUncaught = true;
suite.beforeEach(function(){
throw new Error('allow unhandled errors in hooks');
});
function fail() {
runner.hook('beforeEach', function() {});
}
fail.should.throw('allow unhandled errors in hooks');
done();
});
});

describe('stackTrace', function() {
Expand Down

0 comments on commit 46654cd

Please sign in to comment.