Replace old "catch exceptions" logic with proper fail fast with error reporting

- Option is called stopOnSpecFailure

[#85966014]
- See #414
- See jasmine/jasmine-npm#16
This commit is contained in:
Gregg Van Hove
2018-01-30 11:36:56 -08:00
parent e908b67b19
commit e15f273f06
14 changed files with 191 additions and 133 deletions

View File

@@ -947,4 +947,30 @@ describe("spec running", function () {
env.execute();
});
});
describe("when stopOnSpecFailure is on", function() {
it("does not run further specs when one fails", function(done) {
var actions = [];
env.it('fails', function() {
actions.push('fails');
env.expect(1).toBe(2);
});
env.it('does not run', function() {
actions.push('does not run');
});
env.randomizeTests(false);
env.stopOnSpecFailure(true);
var assertions = function() {
expect(actions).toEqual(['fails']);
done();
};
env.addReporter({ jasmineDone: assertions });
env.execute();
});
});
});