From 648315284a68a631d8372d11ff438260fe5c50c3 Mon Sep 17 00:00:00 2001 From: spalger Date: Wed, 30 Sep 2020 10:42:43 -0700 Subject: [PATCH] just import the fields globally in the tests, preventing timeout --- .../search_strategy/index_fields/index.test.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/security_solution/server/search_strategy/index_fields/index.test.ts b/x-pack/plugins/security_solution/server/search_strategy/index_fields/index.test.ts index 6cc325fc81625..04e81e4c934b3 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/index_fields/index.test.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/index_fields/index.test.ts @@ -8,17 +8,16 @@ import { sortBy } from 'lodash/fp'; import { formatIndexFields, formatFirstFields, formatSecondFields, createFieldItem } from './index'; import { mockAuditbeatIndexField, mockFilebeatIndexField, mockPacketbeatIndexField } from './mock'; +import { fieldsBeat as beatFields } from '../../utils/beat_schema/fields'; describe('Index Fields', () => { describe('formatIndexFields', () => { test('Basic functionality', async () => { - const { fieldsBeat } = await import('../../utils/beat_schema/fields'); - expect( sortBy( 'name', await formatIndexFields( - fieldsBeat, + beatFields, [mockAuditbeatIndexField, mockFilebeatIndexField, mockPacketbeatIndexField], ['auditbeat', 'filebeat', 'packetbeat'] ) @@ -169,10 +168,8 @@ describe('Index Fields', () => { describe('formatFirstFields', () => { test('Basic functionality', async () => { - const { fieldsBeat } = await import('../../utils/beat_schema/fields'); - const fields = await formatFirstFields( - fieldsBeat, + beatFields, [mockAuditbeatIndexField, mockFilebeatIndexField, mockPacketbeatIndexField], ['auditbeat', 'filebeat', 'packetbeat'] ); @@ -753,11 +750,9 @@ describe('Index Fields', () => { }); describe('createFieldItem', () => { - test('Basic functionality', async () => { - const { fieldsBeat } = await import('../../utils/beat_schema/fields'); - - const item = await createFieldItem( - fieldsBeat, + test('Basic functionality', () => { + const item = createFieldItem( + beatFields, ['auditbeat'], { name: '_id',