ohmybuck

Mocking dates in jest

November 21, 2019

new Date(Date.now());

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

Credit to Hugo’s post


Written by Oliver Smit. I love talking about web technologies, good design practices, optimising productivity, and rapid prototyping of projects. Check out my work on Github