-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
This is somewhat related to issue #577, but different because it deals with beforeAll instead of beforeEach. In many situations, I imagine that a failure in beforeAll means that there's no useful information to be gained from continuing the test. It would be nice to immediately fail without trying to run each of the specs after that.
Expected Behavior
describe('bad setup', function() {
beforeAll(function() {
throw new Error('error from beforeAll');
});
it('test 1', function() {
expect(1).toEqual(11);
});
});Expected behavior - output:
Suite error: bad setup
Message:
Error: error from beforeAll
Current Behavior
Output tries to run all tests:
Failures:
-
bad setup test 1
Message:
Expected 1 to equal 11.
Stack:
... -
bad setup test 2
Message:
Expected 2 to equal 22.
Stack:
...
Suite error: bad error
Message:
Error: error from beforeAll
Suite that reproduces the behavior (for bugs)
describe('bad setup', function() {
beforeAll(function() {
throw new Error('error from beforeAll');
});
it('test 1', function() {
expect(1).toEqual(11);
});
});Your Environment
Jasmine 3.1. I believe this behavior is the same in all environments. I have tried both with and without stopSpecOnExpectationFailure