mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Restore global setTimeout to get into a clean state again
This commit is contained in:
parent
0784680f78
commit
fef124e800
@ -64,6 +64,14 @@ describe('AwsProvider', () => {
|
||||
});
|
||||
|
||||
describe('#request()', () => {
|
||||
beforeEach(() => {
|
||||
sinon.stub(global, 'setTimeout', (cb) => { cb(); });
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
global.setTimeout.restore();
|
||||
});
|
||||
|
||||
it('should call correct aws method', () => {
|
||||
// mocking S3 for testing
|
||||
class FakeS3 {
|
||||
@ -98,7 +106,6 @@ describe('AwsProvider', () => {
|
||||
});
|
||||
|
||||
it('should retry if error code is 429', (done) => {
|
||||
sinon.stub(global, 'setTimeout', (cb) => { cb(); });
|
||||
let first = true;
|
||||
const error = {
|
||||
statusCode: 429,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user