From d3adc16a08d95d6e331de55d7d3bf05a66a874a8 Mon Sep 17 00:00:00 2001 From: pack Date: Sun, 9 Aug 2026 10:54:08 +0000 Subject: stop tracking node_modules/ --- .../src/delay/always/always.delay.spec.ts | 65 ---------------------- 1 file changed, 65 deletions(-) delete mode 100644 node_modules/exponential-backoff/src/delay/always/always.delay.spec.ts (limited to 'node_modules/exponential-backoff/src/delay/always/always.delay.spec.ts') diff --git a/node_modules/exponential-backoff/src/delay/always/always.delay.spec.ts b/node_modules/exponential-backoff/src/delay/always/always.delay.spec.ts deleted file mode 100644 index 8a08cd8..0000000 --- a/node_modules/exponential-backoff/src/delay/always/always.delay.spec.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { AlwaysDelay } from "./always.delay"; -import { IBackOffOptions, getSanitizedOptions } from "../../options"; - -describe(AlwaysDelay.name, () => { - let options: IBackOffOptions; - let delay: AlwaysDelay; - - function initClass() { - delay = new AlwaysDelay(options); - } - - beforeEach(() => { - options = getSanitizedOptions({}); - initClass(); - jest.useFakeTimers(); - }); - - it(`when calling #apply, the delay is equal to the starting delay`, async () => { - const spy = jest.fn(); - delay.apply().then(spy); - jest.runTimersToTime(options.startingDelay); - await Promise.resolve(); - - expect(spy).toHaveBeenCalledTimes(1); - }); - - it(`when the attempt number is 1, when calling #apply, - the delay is equal to the starting delay multiplied by the time multiple`, async () => { - delay.setAttemptNumber(1); - - const spy = jest.fn(); - delay.apply().then(spy); - jest.runTimersToTime(options.startingDelay * options.timeMultiple); - await Promise.resolve(); - - expect(spy).toHaveBeenCalledTimes(1); - }); - - it(`when the attempt number is 2, when calling #apply, - the delay is equal to the starting delay multiplied by the time multiple raised by the attempt number`, async () => { - const attemptNumber = 2; - delay.setAttemptNumber(attemptNumber); - - const spy = jest.fn(); - delay.apply().then(spy); - jest.runTimersToTime( - options.startingDelay * Math.pow(options.timeMultiple, attemptNumber) - ); - await Promise.resolve(); - - expect(spy).toHaveBeenCalledTimes(1); - }); - - it(`when the #maxDelay is less than #startingDelay, when calling #apply, - the delay is equal to the #maxDelay`, async () => { - options.maxDelay = options.startingDelay - 1; - - const spy = jest.fn(); - delay.apply().then(spy); - jest.runTimersToTime(options.maxDelay); - await Promise.resolve(); - - expect(spy).toHaveBeenCalledTimes(1); - }); -}); -- cgit v1.2.3