Skip to content

Commit

Permalink
removed text in JSOPN parse
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Oct 27, 2020
1 parent 314f3bc commit e59ebc0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions x-pack/plugins/task_manager/server/routes/health.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ describe('healthRoute', () => {
await sleep(600);
stats$.next(nextMockStat);

const firstDebug = JSON.parse((logger as jest.Mocked<Logger>).debug.mock.calls[0][0]);
const firstDebug = JSON.parse(
(logger as jest.Mocked<Logger>).debug.mock.calls[0][0].replace('Latest Monitored Stats: ', '')
);
expect(firstDebug).toMatchObject({
id,
timestamp: expect.any(String),
status: expect.any(String),
...summarizeMonitoringStats(mockStat, getTaskManagerConfig({})),
});

const secondDebug = JSON.parse((logger as jest.Mocked<Logger>).debug.mock.calls[1][0]);
const secondDebug = JSON.parse(
(logger as jest.Mocked<Logger>).debug.mock.calls[1][0].replace('Latest Monitored Stats: ', '')
);
expect(secondDebug).not.toMatchObject({
id,
timestamp: expect.any(String),
Expand Down

0 comments on commit e59ebc0

Please sign in to comment.