DEV Community

Teerasak Vichadee
Teerasak Vichadee

Posted on

Mock new Date with sinon

const mockNow = new Date()

beforeEach(() => {
  sinon.useFakeTimers(mockNow.getTime())
})
Enter fullscreen mode Exit fullscreen mode

Bye

Discussion (0)