@@ -54,17 +54,13 @@ type JestMockFn<TArguments: $ReadOnlyArray<*>, TReturn> = {
5454 * that come from itself -- the only difference is that the implementation
5555 * will also be executed when the mock is called.
5656 */
57- mockImplementation (
58- fn : ( ...args : TArguments ) = > TReturn
59- ) : JestMockFn < TArguments , TReturn > ,
57+ mockImplementation ( fn : ( ...args : TArguments ) = > TReturn ) : JestMockFn < TArguments , TReturn > ,
6058 /**
6159 * Accepts a function that will be used as an implementation of the mock for
6260 * one call to the mocked function. Can be chained so that multiple function
6361 * calls produce different results.
6462 */
65- mockImplementationOnce (
66- fn : ( ...args : TArguments ) = > TReturn
67- ) : JestMockFn < TArguments , TReturn > ,
63+ mockImplementationOnce ( fn : ( ...args : TArguments ) = > TReturn ) : JestMockFn < TArguments , TReturn > ,
6864 /**
6965 * Accepts a string to use in test result output in place of "jest.fn()" to
7066 * indicate which mock function is being referenced.
@@ -89,9 +85,7 @@ type JestMockFn<TArguments: $ReadOnlyArray<*>, TReturn> = {
8985 /**
9086 * Sugar for jest.fn().mockImplementationOnce(() => Promise.resolve(value))
9187 */
92- mockResolvedValueOnce (
93- value : TReturn
94- ) : JestMockFn < TArguments , Promise < TReturn >> ,
88+ mockResolvedValueOnce ( value : TReturn ) : JestMockFn < TArguments , Promise < TReturn >> ,
9589 /**
9690 * Sugar for jest.fn().mockImplementation(() => Promise.reject(value))
9791 */
@@ -182,7 +176,7 @@ type JestStyledComponentsMatchersType = {
182176 toHaveStyleRule (
183177 property : string ,
184178 value : JestStyledComponentsMatcherValue ,
185- options ?: JestStyledComponentsMatcherOptions
179+ options ?: JestStyledComponentsMatcherOptions ,
186180 ) : void ,
187181 ...
188182} ;
@@ -205,20 +199,17 @@ type EnzymeMatchersType = {
205199 toExist ( ) : void ,
206200 toHaveClassName ( className : string ) : void ,
207201 toHaveHTML ( html : string ) : void ,
208- toHaveProp : ( ( propKey : string , propValue ? : any ) => void ) &
209- ( ( props : { ... } ) => void ) ,
202+ toHaveProp : ( ( propKey : string , propValue ? : any ) => void ) & ( ( props : { ... } ) => void ) ,
210203 toHaveRef ( refName : string ) : void ,
211- toHaveState : ( ( stateKey : string , stateValue ? : any ) => void ) &
212- ( ( state : { ... } ) => void ) ,
213- toHaveStyle : ( ( styleKey : string , styleValue ? : any ) => void ) &
214- ( ( style : { ... } ) => void ) ,
204+ toHaveState : ( ( stateKey : string , stateValue ? : any ) => void ) & ( ( state : { ... } ) => void ) ,
205+ toHaveStyle : ( ( styleKey : string , styleValue ? : any ) => void ) & ( ( style : { ... } ) => void ) ,
215206 toHaveTagName ( tagName : string ) : void ,
216207 toHaveText ( text : string ) : void ,
217208 toHaveValue ( value : any ) : void ,
218209 toIncludeText ( text : string ) : void ,
219210 toMatchElement (
220211 element : React$Element < any > ,
221- options ?: { | ignoreProps ?: boolean , verbose ?: boolean | }
212+ options ?: { | ignoreProps ?: boolean , verbose ?: boolean | } ,
222213 ) : void ,
223214 toMatchSelector ( selector : string ) : void ,
224215 // 7.x
@@ -250,10 +241,7 @@ type DomTestingLibraryType = {
250241 toHaveFocus ( ) : void ,
251242 toHaveFormValues ( expectedValues : { [ name : string ] : any , ... } ) : void ,
252243 toHaveStyle ( css : string | { [ name : string ] : any , ... } ) : void ,
253- toHaveTextContent (
254- text : string | RegExp ,
255- options ?: { | normalizeWhitespace : boolean | }
256- ) : void ,
244+ toHaveTextContent ( text : string | RegExp , options ?: { | normalizeWhitespace : boolean | } ) : void ,
257245 toHaveValue ( value ?: string | string [ ] | number ) : void ,
258246
259247 // 5.x
@@ -562,7 +550,7 @@ type SnapshotDiffType = {
562550 aAnnotation ?: string ,
563551 bAnnotation ?: string ,
564552 | } ,
565- testName ?: string
553+ testName ?: string ,
566554 ) : void ,
567555 ...
568556} ;
@@ -816,7 +804,7 @@ type JestObjectType = {
816804 * implementation.
817805 */
818806 fn < TArguments : $ReadOnlyArray < * > , TReturn > (
819- implementation ?: ( ...args : TArguments ) => TReturn
807+ implementation ?: ( ...args : TArguments ) => TReturn ,
820808 ) : JestMockFn < TArguments , TReturn > ,
821809 /**
822810 * Determines if the given function is a mocked function.
@@ -836,11 +824,7 @@ type JestObjectType = {
836824 * The third argument can be used to create virtual mocks -- mocks of modules
837825 * that don't exist anywhere in the system.
838826 */
839- mock (
840- moduleName : string ,
841- moduleFactory ? : any ,
842- options ? : Object
843- ) : JestObjectType ,
827+ mock ( moduleName : string , moduleFactory ? : any , options ? : Object ) : JestObjectType ,
844828 /**
845829 * Returns the actual module instead of a mock, bypassing all checks on
846830 * whether the module should receive a mock implementation or not.
@@ -920,11 +904,7 @@ type JestObjectType = {
920904 * Creates a mock function similar to jest.fn but also tracks calls to
921905 * object[methodName].
922906 */
923- spyOn (
924- object : Object ,
925- methodName : string ,
926- accessType ? : 'get' | 'set'
927- ) : JestMockFn < any , any > ,
907+ spyOn ( object : Object , methodName : string , accessType ? : 'get' | 'set' ) : JestMockFn < any , any > ,
928908 /**
929909 * Set the default timeout interval for tests and before/after hooks in milliseconds.
930910 * Note: The default timeout interval is 5 seconds if this method is not called.
@@ -941,25 +921,13 @@ type JestDoneFn = {|
941921| } ;
942922
943923/** Runs this function after every test inside this context */
944- declare function afterEach (
945- fn : ( done : JestDoneFn ) = > ?Promise < mixed > ,
946- timeout ?: number
947- ) : void ;
924+ declare function afterEach ( fn : ( done : JestDoneFn ) = > ?Promise < mixed > , timeout ?: number ) : void ;
948925/** Runs this function before every test inside this context */
949- declare function beforeEach (
950- fn : ( done : JestDoneFn ) = > ?Promise < mixed > ,
951- timeout ?: number
952- ) : void ;
926+ declare function beforeEach ( fn : ( done : JestDoneFn ) = > ?Promise < mixed > , timeout ?: number ) : void ;
953927/** Runs this function after all tests have finished inside this context */
954- declare function afterAll (
955- fn : ( done : JestDoneFn ) = > ?Promise < mixed > ,
956- timeout ?: number
957- ) : void ;
928+ declare function afterAll ( fn : ( done : JestDoneFn ) = > ?Promise < mixed > , timeout ?: number ) : void ;
958929/** Runs this function before any tests have started inside this context */
959- declare function beforeAll (
960- fn : ( done : JestDoneFn ) = > ?Promise < mixed > ,
961- timeout ?: number
962- ) : void ;
930+ declare function beforeAll ( fn : ( done : JestDoneFn ) = > ?Promise < mixed > , timeout ?: number ) : void ;
963931
964932/** A context for grouping tests together */
965933declare var describe : {
@@ -982,11 +950,7 @@ declare var describe: {
982950 */
983951 each (
984952 ...table : Array < Array < mixed > | mixed > | [ Array < string > , string ]
985- ) : (
986- name : JestTestName ,
987- fn ?: ( ...args : Array < any > ) => ?Promise < mixed > ,
988- timeout ?: number
989- ) => void ,
953+ ) : ( name : JestTestName , fn ?: ( ...args : Array < any > ) => ?Promise < mixed > , timeout ?: number ) => void ,
990954 ...
991955} ;
992956
@@ -999,11 +963,7 @@ declare var it: {
999963 * @param {Function } Test
1000964 * @param {number } Timeout for the test, in milliseconds.
1001965 */
1002- (
1003- name : JestTestName ,
1004- fn ?: ( done : JestDoneFn ) => ?Promise < mixed > ,
1005- timeout ?: number
1006- ) : void ,
966+ ( name : JestTestName , fn ?: ( done : JestDoneFn ) => ?Promise < mixed > , timeout ?: number ) : void ,
1007967 /**
1008968 * Only run this test
1009969 *
@@ -1012,17 +972,13 @@ declare var it: {
1012972 * @param {number } Timeout for the test, in milliseconds.
1013973 */
1014974 only : { |
1015- (
1016- name : JestTestName ,
1017- fn ?: ( done : JestDoneFn ) => ?Promise < mixed > ,
1018- timeout ?: number
1019- ) : void ,
975+ ( name : JestTestName , fn ?: ( done : JestDoneFn ) => ?Promise < mixed > , timeout ?: number ) : void ,
1020976 each (
1021977 ...table : Array < Array < mixed > | mixed > | [ Array < string > , string ]
1022978 ) : (
1023979 name : JestTestName ,
1024980 fn ?: ( ...args : Array < any > ) => ?Promise < mixed > ,
1025- timeout ?: number
981+ timeout ?: number ,
1026982 ) => void ,
1027983 | } ,
1028984 /**
@@ -1032,11 +988,7 @@ declare var it: {
1032988 * @param {Function } Test
1033989 * @param {number } Timeout for the test, in milliseconds.
1034990 */
1035- skip (
1036- name : JestTestName ,
1037- fn ?: ( done : JestDoneFn ) => ?Promise < mixed > ,
1038- timeout ?: number
1039- ) : void ,
991+ skip ( name : JestTestName , fn ?: ( done : JestDoneFn ) => ?Promise < mixed > , timeout ?: number ) : void ,
1040992 /**
1041993 * Highlight planned tests in the summary output
1042994 *
@@ -1053,7 +1005,7 @@ declare var it: {
10531005 concurrent (
10541006 name : JestTestName ,
10551007 fn ?: ( done : JestDoneFn ) => ?Promise < mixed > ,
1056- timeout ?: number
1008+ timeout ?: number ,
10571009 ) : void ,
10581010 /**
10591011 * each runs this test against array of argument arrays per each run
@@ -1062,18 +1014,14 @@ declare var it: {
10621014 */
10631015 each (
10641016 ...table : Array < Array < mixed > | mixed > | [ Array < string > , string ]
1065- ) : (
1066- name : JestTestName ,
1067- fn ?: ( ...args : Array < any > ) => ?Promise < mixed > ,
1068- timeout ?: number
1069- ) = > void ,
1017+ ) : ( name : JestTestName , fn ?: ( ...args : Array < any > ) => ?Promise < mixed > , timeout ?: number ) = > void ,
10701018 ...
10711019} ;
10721020
10731021declare function fit (
10741022 name : JestTestName ,
10751023 fn : ( done : JestDoneFn ) = > ?Promise < mixed > ,
1076- timeout ?: number
1024+ timeout ?: number ,
10771025) : void ;
10781026/** An individual test unit */
10791027declare var test : typeof it ;
@@ -1146,7 +1094,7 @@ type JestPrettyFormatPlugin = {
11461094 serialize : JestPrettyFormatPrint ,
11471095 indent : JestPrettyFormatIndent ,
11481096 opts : JestPrettyFormatOptions ,
1149- colors : JestPrettyFormatColors
1097+ colors : JestPrettyFormatColors ,
11501098 ) => string,
11511099 test : ( any ) => boolean ,
11521100 ...
@@ -1158,7 +1106,7 @@ type JestPrettyFormatPlugins = Array<JestPrettyFormatPlugin>;
11581106declare var expect : {
11591107 /** The object that you want to make assertions against */
11601108 (
1161- value : any
1109+ value : any ,
11621110 ) : JestExpectType &
11631111 JestPromiseType &
11641112 EnzymeMatchersType &
@@ -1210,7 +1158,7 @@ declare var jasmine: {
12101158 createSpy ( name : string ) : JestSpyType ,
12111159 createSpyObj (
12121160 baseName : string ,
1213- methodNames : Array < string >
1161+ methodNames : Array < string > ,
12141162 ) : { [ methodName : string ] : JestSpyType , ... } ,
12151163 objectContaining ( value : Object ) : Object ,
12161164 stringMatching ( value : string ) : string ,
0 commit comments