From 8ba86ff1077abb95730b54196301eab517f97e64 Mon Sep 17 00:00:00 2001 From: Alan Cruikshanks Date: Tue, 19 Dec 2023 17:03:40 +0000 Subject: [PATCH] Changes needed to get the unit tests passing again --- test/lib/request.lib.test.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/lib/request.lib.test.js b/test/lib/request.lib.test.js index 365f4a1844..4998a43355 100644 --- a/test/lib/request.lib.test.js +++ b/test/lib/request.lib.test.js @@ -15,7 +15,7 @@ const requestConfig = require('../../config/request.config.js') // Thing under test const RequestLib = require('../../app/lib/request.lib.js') -describe.only('RequestLib', () => { +describe('RequestLib', () => { const testDomain = 'http://example.com' const shortBackoffLimitRetryOptions = { ...RequestLib.defaultOptions.retry, @@ -141,7 +141,9 @@ describe.only('RequestLib', () => { Sinon.replace(requestConfig, 'timeout', 50) }) - describe('and all retries fail', () => { + // Because of the fake delay in this test, Lab will timeout (by default tests have 2 seconds to finish). So, we + // have to override the timeout for this specific test to all it to complete + describe('and all retries fail', { timeout: 5000 }, () => { beforeEach(async () => { Nock(testDomain) .get(() => true) @@ -348,7 +350,9 @@ describe.only('RequestLib', () => { Sinon.replace(requestConfig, 'timeout', 50) }) - describe('and all retries fail', () => { + // Because of the fake delay in this test, Lab will timeout (by default tests have 2 seconds to finish). So, we + // have to override the timeout for this specific test to all it to complete + describe('and all retries fail', { timeout: 5000 }, () => { beforeEach(async () => { Nock(testDomain) .patch(() => true) @@ -555,7 +559,9 @@ describe.only('RequestLib', () => { Sinon.replace(requestConfig, 'timeout', 50) }) - describe('and all retries fail', () => { + // Because of the fake delay in this test, Lab will timeout (by default tests have 2 seconds to finish). So, we + // have to override the timeout for this specific test to all it to complete + describe('and all retries fail', { timeout: 5000 }, () => { beforeEach(async () => { Nock(testDomain) .post(() => true)