timkindberg / jest-when

Jest support for mock argument-matched return values.
MIT License
738 stars 39 forks source link

Remove a layer of indirection for defaultRejectedValue #101

Closed benjaminjkraft closed 1 year ago

benjaminjkraft commented 1 year ago

Came across this while evaluating the library -- it looks like it was inadvertently doing Promise.resolve(Promise.reject(err)). That's mostly equivalent enough to Promise.reject(err), but we might as well just do the simple thing.

timkindberg commented 1 year ago

Ah yeah makes sense.

timkindberg commented 1 year ago

Thanks!