Untitled
unknown
plain_text
17 days ago
295 B
2
Indexable
Never
it("test", async () => { const fakeDate = new Date("2023-04-22"); console.log("Normal: ", new Date().getTime()); const spy = jest.spyOn(global, "Date").mockImplementation(() => fakeDate); console.log("Mocked: ", new Date().getTime()); });
Leave a Comment