diff --git a/x-pack/plugins/uptime/public/components/common/charts/__tests__/ping_histogram.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/__tests__/ping_histogram.test.tsx index 57a38f2a949e7..73c6ee43ccd07 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/__tests__/ping_histogram.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/__tests__/ping_histogram.test.tsx @@ -7,8 +7,13 @@ import React from 'react'; import { PingHistogramComponent, PingHistogramComponentProps } from '../ping_histogram'; import { renderWithRouter, shallowWithRouter, MountWithReduxProvider } from '../../../../lib'; +import moment from 'moment'; describe('PingHistogram component', () => { + beforeAll(() => { + moment.prototype.fromNow = jest.fn(() => 'a year ago'); + }); + const props: PingHistogramComponentProps = { absoluteStartDate: 1548697920000, absoluteEndDate: 1548700920000,