Skip to content

Commit

Permalink
just import the fields globally in the tests, preventing timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Sep 30, 2020
1 parent feb00cb commit 6483152
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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']
)
Expand Down Expand Up @@ -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']
);
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 6483152

Please sign in to comment.