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've stumbled upon this error in a different context. It's because sonner does an outdated check if a promise is a Promise.
This is the responsible line of code: src/state.ts#L124
A promise doesn't need to be an instance of Promise to be a promise (yeah ... I know). It only needs to have a .then() method. This Stackoverflow answer has a good summary.
TL;DR: Sonner should use Promise.resolve(foo) instead of testing for type.
Describe the feature / bug 📝:
I'm currently using sonner like the following
When testing I want to mock out this api call but when used in tandem with sonner this fails with the following error.
A workaround I am using is to manually handle the states with the
apiCall.then().catch()
methodsSteps to reproduce the bug 🔁:
jest.spyOn
I can try to add more details so let me know what else might be useful.
The text was updated successfully, but these errors were encountered: