Mocking Date.now()
in a jest unit test.
jest
.spyOn(global.Date, 'now')
.mockImplementationOnce(() =>
new Date('2010-10-10T10:10:10.100Z').valueOf()
);
Mocking Date.now()
in a jest unit test.
jest
.spyOn(global.Date, 'now')
.mockImplementationOnce(() =>
new Date('2010-10-10T10:10:10.100Z').valueOf()
);
For further actions, you may consider blocking this person and/or reporting abuse
Lem -
Andrew Park -
Owen Roth -
omkar shelke -
Top comments (0)