1
- // flow-typed signature: 9a1f9054d272cf6383233b8bfb639f84
2
- // flow-typed version: 4efeddffd8 /jest_v26.x.x/flow_>=v0.104 .x
1
+ // flow-typed signature: 681725d1525989df4ff4c352015f5c2b
2
+ // flow-typed version: 9a968c602c /jest_v26.x.x/flow_>=v0.201 .x
3
3
4
- type JestMockFn < TArguments : $ReadOnlyArray < * > , TReturn > = {
4
+ type JestMockFn < TArguments : $ReadOnlyArray < any > , TReturn > = {
5
5
( ...args : TArguments ) : TReturn ,
6
6
/**
7
7
* An object for introspecting mock calls
@@ -259,6 +259,9 @@ type DomTestingLibraryType = {
259
259
// 5.x
260
260
toHaveDisplayValue ( value : string | string [ ] ) : void ,
261
261
toBeChecked ( ) : void ,
262
+ toBeEmptyDOMElement ( ) : void ,
263
+ toBePartiallyChecked ( ) : void ,
264
+ toHaveDescription ( text : string | RegExp ) : void ,
262
265
...
263
266
} ;
264
267
@@ -624,7 +627,7 @@ interface JestExpectType {
624
627
* Use .toBeInstanceOf(Class) to check that an object is an instance of a
625
628
* class.
626
629
*/
627
- toBeInstanceOf ( cls : Class < * > ) : void ;
630
+ toBeInstanceOf ( cls : Class < any > ) : void ;
628
631
/**
629
632
* .toBeNull() is the same as .toBe(null) but the error messages are a bit
630
633
* nicer.
@@ -801,6 +804,14 @@ type JestObjectType = {
801
804
* Returns the number of fake timers still left to run.
802
805
*/
803
806
getTimerCount ( ) : number ,
807
+ /**
808
+ * Set the current system time used by fake timers.
809
+ * Simulates a user changing the system clock while your program is running.
810
+ * It affects the current time but it does not in itself cause
811
+ * e.g. timers to fire; they will fire exactly as they would have done
812
+ * without the call to jest.setSystemTime().
813
+ */
814
+ setSystemTime ( now ?: number | Date ) : void ,
804
815
/**
805
816
* The same as `mock` but not moved to the top of the expectation by
806
817
* babel-jest.
@@ -815,18 +826,22 @@ type JestObjectType = {
815
826
* Returns a new, unused mock function. Optionally takes a mock
816
827
* implementation.
817
828
*/
818
- fn < TArguments : $ReadOnlyArray < * > , TReturn > (
829
+ fn < TArguments : $ReadOnlyArray < any > , TReturn > (
819
830
implementation ?: ( ...args : TArguments ) => TReturn ,
820
831
) : JestMockFn < TArguments , TReturn > ,
821
832
/**
822
833
* Determines if the given function is a mocked function.
823
834
*/
824
835
isMockFunction ( fn : Function ) : boolean ,
836
+ /**
837
+ * Alias of `createMockFromModule`.
838
+ */
839
+ genMockFromModule ( moduleName : string ) : any ,
825
840
/**
826
841
* Given the name of a module, use the automatic mocking system to generate a
827
842
* mocked version of the module for you.
828
843
*/
829
- genMockFromModule ( moduleName : string ) : any ,
844
+ createMockFromModule ( moduleName : string ) : any ,
830
845
/**
831
846
* Mocks a module with an auto-mocked version when it is being required.
832
847
*
@@ -845,7 +860,7 @@ type JestObjectType = {
845
860
* Returns the actual module instead of a mock, bypassing all checks on
846
861
* whether the module should receive a mock implementation or not.
847
862
*/
848
- requireActual ( moduleName : string ) : any ,
863
+ requireActual < T > ( m : $Flow$ModuleRef < T > | string ) : T ,
849
864
/**
850
865
* Returns a mock module instead of the actual module, bypassing all checks
851
866
* on whether the module should be required normally or not.
@@ -1032,11 +1047,20 @@ declare var it: {
1032
1047
* @param {Function } Test
1033
1048
* @param {number } Timeout for the test, in milliseconds.
1034
1049
*/
1035
- skip (
1036
- name : JestTestName ,
1037
- fn ?: ( done : JestDoneFn ) => ?Promise < mixed > ,
1038
- timeout ?: number ,
1039
- ) : void ,
1050
+ skip : { |
1051
+ (
1052
+ name : JestTestName ,
1053
+ fn ?: ( done : JestDoneFn ) => ?Promise < mixed > ,
1054
+ timeout ?: number ,
1055
+ ) : void ,
1056
+ each (
1057
+ ...table : Array < Array < mixed > | mixed > | [ Array < string > , string ]
1058
+ ) : (
1059
+ name : JestTestName ,
1060
+ fn ?: ( ...args : Array < any > ) => ?Promise < mixed > ,
1061
+ timeout ?: number ,
1062
+ ) => void ,
1063
+ | } ,
1040
1064
/**
1041
1065
* Highlight planned tests in the summary output
1042
1066
*
0 commit comments