Skip to content

Commit 1709e11

Browse files
committed
[ML] Simplify mock.
1 parent a0f9d4f commit 1709e11

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

x-pack/plugins/apm/server/lib/search_strategies/search_service_log.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('search service', () => {
1515
it('returns the current time as a string', () => {
1616
const mockDate = new Date(1392202800000);
1717
// @ts-ignore ignore the mockImplementation callback error
18-
const spy = jest.spyOn(global, 'Date').mockImplementation(() => mockDate);
18+
const spy = jest.spyOn(global, 'Date').mockReturnValue(mockDate);
1919

2020
const timeString = currentTimeAsString();
2121

@@ -31,7 +31,7 @@ describe('search service', () => {
3131

3232
const mockDate = new Date(1392202800000);
3333
// @ts-ignore ignore the mockImplementation callback error
34-
const spy = jest.spyOn(global, 'Date').mockImplementation(() => mockDate);
34+
const spy = jest.spyOn(global, 'Date').mockReturnValue(mockDate);
3535

3636
addLogMessage('the first message');
3737
addLogMessage('the second message');

0 commit comments

Comments
 (0)