ohmybuck
home
whoami
github
linkedin
Mocking dates in jest
Updated January 11, 2026
Created November 21, 2019
new Date(Date.now()) const dateSpy = jest.spy(Date, "now")
Credit to
Hugo's post
Comments?