@@ -806,6 +806,26 @@ type JestObjectType = {
806
806
* Returns the number of fake timers still left to run.
807
807
*/
808
808
getTimerCount ( ) : number ,
809
+ /**
810
+ * When mocking time, `Date.now()` will also be mocked. If you for
811
+ * some reason need access to the real current time, you can invoke
812
+ * this function.
813
+ *
814
+ * > Note: This function is only available when using modern fake
815
+ * > timers implementation
816
+ */
817
+ getRealSystemTime ( ) : number ,
818
+ /**
819
+ * Set the current system time used by fake timers. Simulates a
820
+ * user changing the system clock while your program is running. It
821
+ * affects the current time but it does not in itself cause e.g.
822
+ * timers to fire; they will fire exactly as they would have done
823
+ * without the call to `jest.setSystemTime()`.
824
+ *
825
+ * > Note: This function is only available when using modern fake
826
+ * > timers implementation
827
+ */
828
+ setSystemTime ( now ?: number | Date ) : void ,
809
829
/**
810
830
* The same as `mock` but not moved to the top of the expectation by
811
831
* babel-jest.
@@ -921,26 +941,6 @@ type JestObjectType = {
921
941
* Instructs Jest to use the real versions of the standard timer functions.
922
942
*/
923
943
useRealTimers ( ) : JestObjectType ,
924
- /**
925
- * When mocking time, `Date.now()` will also be mocked. If you for
926
- * some reason need access to the real current time, you can invoke
927
- * this function.
928
- *
929
- * > Note: This function is only available when using modern fake
930
- * > timers implementation
931
- */
932
- getRealSystemTime ( ) : number ,
933
- /**
934
- * Set the current system time used by fake timers. Simulates a
935
- * user changing the system clock while your program is running. It
936
- * affects the current time but it does not in itself cause e.g.
937
- * timers to fire; they will fire exactly as they would have done
938
- * without the call to `jest.setSystemTime()`.
939
- *
940
- * > Note: This function is only available when using modern fake
941
- * > timers implementation
942
- */
943
- setSystemTime ( now ? : number | Date ) : void ,
944
944
/**
945
945
* Creates a mock function similar to jest.fn but also tracks calls to
946
946
* object[methodName].
0 commit comments