Closed akleiber closed 6 years ago
Paging @hally9k who implemented this initial reject mocks.
any progress here? I think I can open a PR for this if necessary :)
I'm trying to use this in conjunction with redux-api-middleware
.
mockReject()
causes e.message to fail as the error is undefined. I suspect the above PR would help solve that but would it also be possible to return an empty Error object if not defined?
above PR is just allow to pass any data to mockReject
and resolve it from promise. so you can pass anything by yourself.
Merged and published to NPM.
While using
mockReject()
ormockRejectOnce()
it could be practical to allow to define the reason of the rejection. Currently both methods just do aPromise.reject()
without any argument.Scenario:
What I think would be nice to have:
If this is something you would support I will create a PR.