From 6b7c8b24a099ce2b5b074db8c7aa36297b97428e Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Sun, 19 Nov 2023 13:21:01 +0100 Subject: [PATCH] text: remove duplicated sinon instantiation --- test/request.ts | 51 ------------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/test/request.ts b/test/request.ts index 6dc1c39e..47d7ac68 100644 --- a/test/request.ts +++ b/test/request.ts @@ -1022,16 +1022,6 @@ describe('request', function () { }) describe('non-confirmable retries', function () { - let clock - - beforeEach(function () { - clock = useFakeTimers() - }) - - afterEach(function () { - clock.restore() - }) - function doReq (): OutgoingMessage { return request({ port, @@ -1039,13 +1029,6 @@ describe('request', function () { }).end() } - function fastForward (increase, max): void { - clock.tick(increase) - if (increase < max) { - originalSetImmediate(fastForward.bind(null, increase, max - increase)) - } - } - it('should timeout after ~202 seconds', function (done) { const req = doReq() @@ -1135,16 +1118,6 @@ describe('request', function () { }) describe('confirmable retries', function () { - let clock - - beforeEach(function () { - clock = useFakeTimers() - }) - - afterEach(function () { - clock.restore() - }) - function doReq (): OutgoingMessage { return request({ port, @@ -1152,13 +1125,6 @@ describe('request', function () { }).end() } - function fastForward (increase, max): void { - clock.tick(increase) - if (increase < max) { - originalSetImmediate(fastForward.bind(null, increase, max - increase)) - } - } - it('should error after ~247 seconds', function (done) { const req = doReq() @@ -1627,23 +1593,6 @@ describe('request', function () { }) describe('token', function () { - let clock - - beforeEach(function () { - clock = useFakeTimers() - }) - - afterEach(function () { - clock.restore() - }) - - function fastForward (increase, max): void { - clock.tick(increase) - if (increase < max) { - originalSetImmediate(fastForward.bind(null, increase, max - increase)) - } - } - it('should timeout if the response token size doesn\'t match the request\'s', function (done) { const req = request({ port