diff --git a/lib/plugins/aws/provider/awsProvider.test.js b/lib/plugins/aws/provider/awsProvider.test.js index 6212abd61..2cf99bee1 100644 --- a/lib/plugins/aws/provider/awsProvider.test.js +++ b/lib/plugins/aws/provider/awsProvider.test.js @@ -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,