import { getDateOneYearInTheFuture, } from './date.functions'; describe('getDateOneYearInTheFuture', () => { test('Returns a date one year in the future', () => { const DATE_TO_USE = new Date(Date.UTC(2000, 0, 1)); (Date.now as any) = jest.fn(() => DATE_TO_USE); const oneYearInTheFuture = getDateOneYearInTheFuture(); expect(oneYearInTheFuture.toUTCString()).toBe( 'Mon, 01 Jan 2001 00:00:00 GMT', ); }); });