You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/JestObjectAPI.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -799,6 +799,10 @@ This means, if any timers have been scheduled (but have not yet executed), they
799
799
800
800
Returns the number of fake timers still left to run.
801
801
802
+
### `jest.now()`
803
+
804
+
Returns the time in ms of the current fake clock. This is equivalent to `Date.now()` if `Date` has been mocked.
805
+
802
806
### `jest.setSystemTime(now?: number | Date)`
803
807
804
808
Set the current system time used by fake timers. Simulates a user changing the system clock while your program is running. It affects the current time but it does not in itself cause e.g. timers to fire; they will fire exactly as they would have done without the call to `jest.setSystemTime()`.
0 commit comments