mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Improve setTimeout stub
Making it sync breaks bluebird internals (e.g. detection of unhandled rejections). With this patch we make sure it's quick enough but still async
This commit is contained in:
parent
c4e5509ba5
commit
73ea7fd9e0
@ -255,7 +255,10 @@ describe('AwsProvider', () => {
|
||||
|
||||
describe('#request()', () => {
|
||||
beforeEach(() => {
|
||||
sinon.stub(global, 'setTimeout', (cb) => { cb(); });
|
||||
const originalSetTimeout = setTimeout;
|
||||
sinon.stub(global, 'setTimeout', (cb, timeout) => {
|
||||
return originalSetTimeout(cb, Math.min(timeout || 0, 10));
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user