Don't throw if we're already handling an exception

[finish #91407284]
This commit is contained in:
Gregg Van Hove
2015-03-30 08:19:06 -07:00
parent d137b83c1c
commit 1d366772b7
3 changed files with 19 additions and 6 deletions

View File

@@ -276,6 +276,19 @@ describe("Spec", function() {
expect(resultCallback.calls.first().args[0].failedExpectations).toEqual(['failed']);
});
it("does not throw an ExpectationFailed error when handling an error", function() {
var resultCallback = jasmine.createSpy('resultCallback'),
spec = new j$.Spec({
queueableFn: { fn: function() {} },
expectationResultFactory: function(data) { return data; },
queueRunnerFactory: function(attrs) { attrs.onComplete(); },
resultCallback: resultCallback,
throwOnExpectationFailure: true
});
spec.onException('failing exception');
});
it("can return its full name", function() {
var specNameSpy = jasmine.createSpy('specNameSpy').and.returnValue('expected val');