How to use the mockdate.reset function in mockdate

To help you get started, we’ve selected a few mockdate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vuikit / vuikit / tests / helpers / DateMatrix.spec.js View on Github external
it('accept no arguments', () => {
    MockDate.set(new Date(2015, 0).valueOf())
    expect(
      matrix(undefined, true).toString()
    ).toEqual(jan15.toString())
    MockDate.reset()
  })
})
github ant-design / ant-design / tests / utils.js View on Github external
export function resetMockDate() {
  MockDate.reset();
}
github RasCarlito / axios-cache-adapter / test / spec / index.spec.js View on Github external
MockDate.set(10000000)

    const api = setup({
      baseURL: 'https://httpbin.org',
      cache: { readHeaders: true }
    })

    const response = await api.get('/cache/2345')

    assert.ok(!response.request.fromCache)

    const item = await api.cache.getItem('https://httpbin.org/cache/2345')

    assert.equal(item.expires, 12345000)

    MockDate.reset()
  })
github cofacts / rumors-api / src / graphql / mutations / __tests__ / UpdateArticleReplyStatus.js View on Github external
afterEach(() => {
    MockDate.reset();
    return unloadFixtures(fixtures);
  });
});
github cozy / cozy.github.io / en / cozy-banks / src / ducks / transactions / helpers.spec.js View on Github external
afterEach(() => {
    MockDate.reset()
  })
  it('should return false if the transaction is not an health expense', () => {
github kartikayg / StatusPage / incidents-service / src / app.spec.js View on Github external
after(function (done) {
    dbConnection.close();
    MockDate.reset();
    messagingQueue.disconnect();
    require('./app').shutdown();
    require('./lib/logger').resetToConsole();

    setTimeout(done, 2000);

  });

mockdate

A JavaScript mock Date object that can be used to change when "now" is.

MIT
Latest version published 4 years ago

Package Health Score

70 / 100
Full package analysis

Popular mockdate functions