import rfc3339 from './rfc3339' const _Date = Date describe('rfc3339', () => { beforeAll(() => { const DATE_TO_USE = new Date(2018, 10, 21, 23, 10, 20) ;(global as any).Date = jest.fn(() => DATE_TO_USE) }) it('generate the rfc3339', () => { expect(rfc3339()).toBe('2018-11-21T23:10:20+01:00') }) afterAll(() => { ;(global as any).Date = _Date }) })