From fef124e800f87ed0d88cf876a89990ea691f37c4 Mon Sep 17 00:00:00 2001 From: Philipp Muens Date: Wed, 15 Mar 2017 12:12:38 +0100 Subject: [PATCH] Restore global setTimeout to get into a clean state again --- lib/plugins/aws/provider/awsProvider.test.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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,