From a5da0a842d7c43f742f78ef4ee261328746ea86e Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Mon, 24 Oct 2022 10:19:35 +0200 Subject: [PATCH] Fix HTTP status error unit test for Kibana 7.16 (#4734) Fix HttpServer configuration parameters --- server/routes/wazuh-api-http-status.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/routes/wazuh-api-http-status.test.ts b/server/routes/wazuh-api-http-status.test.ts index e5150339b6..1306984c76 100644 --- a/server/routes/wazuh-api-http-status.test.ts +++ b/server/routes/wazuh-api-http-status.test.ts @@ -16,6 +16,8 @@ import { } from '../../common/constants'; import { execSync } from 'child_process'; import fs from 'fs'; +import moment from 'moment'; +import { of } from 'rxjs'; const loggingService = loggingSystemMock.create(); const logger = loggingService.get(); @@ -52,8 +54,12 @@ beforeAll(async () => { allowFromAnyIp: true, ipAllowlist: [], }, + cors: { + enabled: false, + }, + shutdownTimeout: moment.duration(500, 'ms'), } as any; - server = new HttpServer(loggingService, 'tests'); + server = new HttpServer(loggingService, 'tests', of(config.shutdownTimeout)); const router = new Router('', logger, enhanceWithContext); const { registerRouter, server: innerServerTest, ...rest } = await server.setup(config); innerServer = innerServerTest;