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 know jest is using the global Promise object, si I've tried adding the following to the top of the tests, and to a file listed in setupFilesAfterEnv, but no effect was noticed.
global.Promise=require('bluebird');
The text was updated successfully, but these errors were encountered:
Actually my "function that returns a bluebird promise" was not such a function, it was an async await function. There is no way that async await function return bluebird promises (petkaantonov/bluebird#1434), so I'll have to move away from using asCallback.
This invalidates my question, as native promises are the future.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
I'm mocking a function that returns a bluebird promise, on which
asCallback
is called.For now, my solution is to use:
Instead of
I know jest is using the global
Promise
object, si I've tried adding the following to the top of the tests, and to a file listed insetupFilesAfterEnv
, but no effect was noticed.The text was updated successfully, but these errors were encountered: