Mocking dates in jest

November 21, 2019

new Date(Date.now())

const dateSpy = jest.spy(Date, "now")

Credit to Hugo's post


Comments?