How can i stub it in tests?
Closed this issue · 4 comments
sonicoder86 commented
When I use the library how can I fake the delay and instead of waiting return an instantly resolving Promise?
SamVerschueren commented
Not sure if I understand what you mean. Can you elaborate a little bit more?
sonicoder86 commented
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.
SamVerschueren commented
proxyquire could help you achieve that.
sindresorhus commented
I would use http://sinonjs.org/docs/#clock