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
Currently, the callsFake() mock does not support throwing an error from it. The error should be returned as a Client send() error, in the same way as mock.rejects() behaves.
Please vote with 👍 if you need this.
The text was updated successfully, but these errors were encountered:
@bgardner-noggin this throws an error from the test that is not caught by jest, so this test fails with an error:
it('throws an error',async()=>{snsMock.on(PublishCommand).callsFake(()=>{thrownewError('forcing error');});constsns=newSNSClient({});awaitexpect(sns.send(publishCmd1)).rejects.toThrow('forcing error');});
However, this nudged me to look into handling errors from callsFake(), and I've just added it and released as v2.2.0.
Currently, the
callsFake()
mock does not support throwing an error from it. The error should be returned as a Clientsend()
error, in the same way asmock.rejects()
behaves.Please vote with 👍 if you need this.
The text was updated successfully, but these errors were encountered: