sindresorhus/delay

How can i stub it in tests?

Closed this issue · 4 comments

When I use the library how can I fake the delay and instead of waiting return an instantly resolving Promise?

Not sure if I understand what you mean. Can you elaborate a little bit more?

I have a method where i use this package.
I want to test it, but don't want the code to wait for the delay, that is why I want to mock/stub it.

proxyquire could help you achieve that.