From 3935938d9e3082ec2280435053942ae4c1cda812 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Tue, 17 Nov 2020 18:08:40 +0100 Subject: [PATCH] [7.x] [Uptime] Mock implementation to account for math flakiness test (#83535) (#83550) --- .../lib/requests/__tests__/get_ping_histogram.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts index 86e5f2876ca28..427061b6c16d4 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts @@ -7,8 +7,13 @@ import { getPingHistogram } from '../get_ping_histogram'; import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; import { elasticsearchServiceMock } from '../../../../../../../src/core/server/mocks'; +import * as intervalHelper from '../../helper/get_histogram_interval'; describe('getPingHistogram', () => { + beforeEach(() => { + jest.spyOn(intervalHelper, 'getHistogramInterval').mockReturnValue(36000); + }); + const standardMockResponse: any = { aggregations: { timeseries: { @@ -36,7 +41,7 @@ describe('getPingHistogram', () => { }, }; - it.skip('returns a single bucket if array has 1', async () => { + it('returns a single bucket if array has 1', async () => { expect.assertions(2); const mockEsClient = elasticsearchServiceMock.createElasticsearchClient();