Skip to content

Commit

Permalink
feat(jest-util): expose method for setting curent system time
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Dec 25, 2017
1 parent b6eaa66 commit 21b46d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/jest-util/src/fake_timers.js
Expand Up @@ -98,6 +98,12 @@ export default class FakeTimers {
}
}

setSystemTime(now?: number) {
if (this._checkFakeTimers()) {
this._clock.setSystemTime(now);
}
}

_checkFakeTimers() {
if (!this._fakingTime) {
this._global.console.warn(
Expand Down

0 comments on commit 21b46d8

Please sign in to comment.