jest-mock-new-date
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

jest-mock-new-date

npm i --save-dev jest-mock-new-date

How to use:

  import { mockDate } from 'jest-mock-new-date'

  describe('...', () => {
    const mockedDate = '2022-03-22T06:14:10.713Z'

    mockDate(mockedDate)
    
    test('...', () => {
      new Date(mockedDate)
    })
  })

/jest-mock-new-date/

    Package Sidebar

    Install

    npm i jest-mock-new-date

    Weekly Downloads

    2

    Version

    1.0.5

    License

    ISC

    Unpacked Size

    2.15 kB

    Total Files

    5

    Last publish

    Collaborators

    • mifrill