You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to have a way to accomplish a verifiable thenThrow.
Ex:
describe('Question 1',function(){describe('Given a closure as argument that causes an error when executed',function(){beforeEach(function(){this.closure=td.function();td.when(this.closure()).thenThrow('foo');});it('Find a way to handle this error',function(){expect(function(){answers.question1(this.closure);}.bind(this)).not.throws();td.verify(this.closure());});});});
This code always fail, if I put the td.verify within a try-catch it pass but as a false positive.
I think I might be able to verify a call without side effects, but I have no sure if it is a bug or something that I could not understand or do correctly.
The text was updated successfully, but these errors were encountered:
1.) It's not necessary to verify calls that you have also stubbed, so this shouldn't be a real issue. If the verification feels necessary then the stub must not be necessary.
2.) Because the stubbing throws an error, a td.verify demonstration will also throw an error. Your only option if you really want to do this is as you stated.
Hi,
I would like to have a way to accomplish a verifiable thenThrow.
Ex:
This code always fail, if I put the td.verify within a try-catch it pass but as a false positive.
I think I might be able to verify a call without side effects, but I have no sure if it is a bug or something that I could not understand or do correctly.
The text was updated successfully, but these errors were encountered: