Skip to content

Commit 6483152

Browse files
committed
just import the fields globally in the tests, preventing timeout
1 parent feb00cb commit 6483152

File tree

1 file changed

+6
-11
lines changed
  • x-pack/plugins/security_solution/server/search_strategy/index_fields

1 file changed

+6
-11
lines changed

x-pack/plugins/security_solution/server/search_strategy/index_fields/index.test.ts

+6-11
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ import { sortBy } from 'lodash/fp';
88

99
import { formatIndexFields, formatFirstFields, formatSecondFields, createFieldItem } from './index';
1010
import { mockAuditbeatIndexField, mockFilebeatIndexField, mockPacketbeatIndexField } from './mock';
11+
import { fieldsBeat as beatFields } from '../../utils/beat_schema/fields';
1112

1213
describe('Index Fields', () => {
1314
describe('formatIndexFields', () => {
1415
test('Basic functionality', async () => {
15-
const { fieldsBeat } = await import('../../utils/beat_schema/fields');
16-
1716
expect(
1817
sortBy(
1918
'name',
2019
await formatIndexFields(
21-
fieldsBeat,
20+
beatFields,
2221
[mockAuditbeatIndexField, mockFilebeatIndexField, mockPacketbeatIndexField],
2322
['auditbeat', 'filebeat', 'packetbeat']
2423
)
@@ -169,10 +168,8 @@ describe('Index Fields', () => {
169168

170169
describe('formatFirstFields', () => {
171170
test('Basic functionality', async () => {
172-
const { fieldsBeat } = await import('../../utils/beat_schema/fields');
173-
174171
const fields = await formatFirstFields(
175-
fieldsBeat,
172+
beatFields,
176173
[mockAuditbeatIndexField, mockFilebeatIndexField, mockPacketbeatIndexField],
177174
['auditbeat', 'filebeat', 'packetbeat']
178175
);
@@ -753,11 +750,9 @@ describe('Index Fields', () => {
753750
});
754751

755752
describe('createFieldItem', () => {
756-
test('Basic functionality', async () => {
757-
const { fieldsBeat } = await import('../../utils/beat_schema/fields');
758-
759-
const item = await createFieldItem(
760-
fieldsBeat,
753+
test('Basic functionality', () => {
754+
const item = createFieldItem(
755+
beatFields,
761756
['auditbeat'],
762757
{
763758
name: '_id',

0 commit comments

Comments
 (0)