Restore global setTimeout to get into a clean state again

This commit is contained in:
Philipp Muens 2017-03-15 12:12:38 +01:00
parent 0784680f78
commit fef124e800

View File

@ -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,