Skip to content

Commit 7fa6c92

Browse files
committed
upgrade to flow v0.204.1
Differential Revision: D45355534nnPull Request resolved: facebookexperimental/Recoil#2226
1 parent 7ec231e commit 7fa6c92

File tree

6 files changed

+46
-28
lines changed

6 files changed

+46
-28
lines changed

.flowconfig

+1-8
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ module.name_mapper='relay-test-utils' -> '<PROJECT_ROOT>/node_modules/relay-test
3939
exact_by_default=true
4040
babel_loose_array_spread=true
4141
enums=true
42-
exact_empty_objects=true
43-
44-
inference_mode=constrain_writes
45-
46-
experimental.enforce_local_inference_annotations=true
47-
experimental.enforce_this_annotations=true
48-
experimental.enforce_class_annotations=true
4942

5043
[strict]
5144
deprecated-type
@@ -59,4 +52,4 @@ untyped-type-import
5952
all=warn
6053

6154
[version]
62-
^0.185.2
55+
^0.204.1

flow-typed/jest.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
type JestMockFn<TArguments: $ReadOnlyArray<*>, TReturn> = {
8+
type JestMockFn<TArguments: $ReadOnlyArray<any>, TReturn> = {
99
(...args: TArguments): TReturn,
1010
/**
1111
* An object for introspecting mock calls
@@ -620,7 +620,7 @@ interface JestExpectType {
620620
* Use .toBeInstanceOf(Class) to check that an object is an instance of a
621621
* class.
622622
*/
623-
toBeInstanceOf(cls: Class<*>): void;
623+
toBeInstanceOf(cls: Class<any>): void;
624624
/**
625625
* .toBeNull() is the same as .toBe(null) but the error messages are a bit
626626
* nicer.
@@ -811,7 +811,7 @@ type JestObjectType = {
811811
* Returns a new, unused mock function. Optionally takes a mock
812812
* implementation.
813813
*/
814-
fn<TArguments: $ReadOnlyArray<*>, TReturn>(
814+
fn<TArguments: $ReadOnlyArray<any>, TReturn>(
815815
implementation?: (...args: TArguments) => TReturn
816816
): JestMockFn<TArguments, TReturn>,
817817
/**

flow-typed/npm/jest_v26.x.x.js

+36-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
33

4-
type JestMockFn<TArguments: $ReadOnlyArray<*>, TReturn> = {
4+
type JestMockFn<TArguments: $ReadOnlyArray<any>, TReturn> = {
55
(...args: TArguments): TReturn,
66
/**
77
* An object for introspecting mock calls
@@ -259,6 +259,9 @@ type DomTestingLibraryType = {
259259
// 5.x
260260
toHaveDisplayValue(value: string | string[]): void,
261261
toBeChecked(): void,
262+
toBeEmptyDOMElement(): void,
263+
toBePartiallyChecked(): void,
264+
toHaveDescription(text: string | RegExp): void,
262265
...
263266
};
264267

@@ -624,7 +627,7 @@ interface JestExpectType {
624627
* Use .toBeInstanceOf(Class) to check that an object is an instance of a
625628
* class.
626629
*/
627-
toBeInstanceOf(cls: Class<*>): void;
630+
toBeInstanceOf(cls: Class<any>): void;
628631
/**
629632
* .toBeNull() is the same as .toBe(null) but the error messages are a bit
630633
* nicer.
@@ -801,6 +804,14 @@ type JestObjectType = {
801804
* Returns the number of fake timers still left to run.
802805
*/
803806
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,
804815
/**
805816
* The same as `mock` but not moved to the top of the expectation by
806817
* babel-jest.
@@ -815,18 +826,22 @@ type JestObjectType = {
815826
* Returns a new, unused mock function. Optionally takes a mock
816827
* implementation.
817828
*/
818-
fn<TArguments: $ReadOnlyArray<*>, TReturn>(
829+
fn<TArguments: $ReadOnlyArray<any>, TReturn>(
819830
implementation?: (...args: TArguments) => TReturn,
820831
): JestMockFn<TArguments, TReturn>,
821832
/**
822833
* Determines if the given function is a mocked function.
823834
*/
824835
isMockFunction(fn: Function): boolean,
836+
/**
837+
* Alias of `createMockFromModule`.
838+
*/
839+
genMockFromModule(moduleName: string): any,
825840
/**
826841
* Given the name of a module, use the automatic mocking system to generate a
827842
* mocked version of the module for you.
828843
*/
829-
genMockFromModule(moduleName: string): any,
844+
createMockFromModule(moduleName: string): any,
830845
/**
831846
* Mocks a module with an auto-mocked version when it is being required.
832847
*
@@ -845,7 +860,7 @@ type JestObjectType = {
845860
* Returns the actual module instead of a mock, bypassing all checks on
846861
* whether the module should receive a mock implementation or not.
847862
*/
848-
requireActual(moduleName: string): any,
863+
requireActual<T>(m: $Flow$ModuleRef<T> | string): T,
849864
/**
850865
* Returns a mock module instead of the actual module, bypassing all checks
851866
* on whether the module should be required normally or not.
@@ -1032,11 +1047,20 @@ declare var it: {
10321047
* @param {Function} Test
10331048
* @param {number} Timeout for the test, in milliseconds.
10341049
*/
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+
|},
10401064
/**
10411065
* Highlight planned tests in the summary output
10421066
*

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"eslint-plugin-relay": "^1.8.3",
7575
"eslint-plugin-rulesdir": "^0.2.0",
7676
"eslint-plugin-unused-imports": "^2.0.0",
77-
"flow-bin": "^0.185.2",
77+
"flow-bin": "0.204.1",
7878
"flow-copy-source": "^2.0.9",
7979
"flow-interfaces-chrome": "^0.6.0",
8080
"flow-typed": "^3.7.0",

packages/shared/__test_utils__/Recoil_TestingUtils.js

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ function renderUnwrappedElements(
166166
renderReactRoot(
167167
div,
168168
isStrictModeEnabled() ? (
169+
// $FlowFixMe[incompatible-call]
169170
<StrictMode>{elements}</StrictMode>
170171
) : (
171172
// $FlowFixMe[incompatible-call]

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -2993,10 +2993,10 @@ flatted@^3.1.0:
29932993
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2"
29942994
integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==
29952995

2996-
flow-bin@^0.185.2:
2997-
version "0.185.2"
2998-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.185.2.tgz#b45a07d45cf641198e86e47848e35f64b0688c4c"
2999-
integrity sha512-Vphs8Z4Qo17dzlPKe/l8M85JvGn1Tf5NV6xESZLg8p9ktdIbNUYaxnq/WBQPoESiLrGdrC2v+rfezfh3tvxkvQ==
2996+
flow-bin@0.204.1:
2997+
version "0.204.1"
2998+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.204.1.tgz#096c1dc5413edfa3f8284f888449f436a10a68fc"
2999+
integrity sha512-gYlDS1cRIV/FnqLc8G0xb/pFdu9eGM+NuxZlihlxRrt3GTfei8IioPSXMpiJz11DPPkiAr9tpIyI+g5RcP1W7Q==
30003000

30013001
flow-copy-source@^2.0.9:
30023002
version "2.0.9"

0 commit comments

Comments
 (0)