Skip to content
This repository was archived by the owner on Jan 1, 2025. It is now read-only.

upgrade to flow v0.204.1 #2226

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ module.name_mapper='relay-test-utils' -> '<PROJECT_ROOT>/node_modules/relay-test
exact_by_default=true
babel_loose_array_spread=true
enums=true
exact_empty_objects=true

inference_mode=constrain_writes

experimental.enforce_local_inference_annotations=true
experimental.enforce_this_annotations=true
experimental.enforce_class_annotations=true

[strict]
deprecated-type
Expand All @@ -59,4 +52,4 @@ untyped-type-import
all=warn

[version]
^0.185.2
^0.204.1
6 changes: 3 additions & 3 deletions flow-typed/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

type JestMockFn<TArguments: $ReadOnlyArray<*>, TReturn> = {
type JestMockFn<TArguments: $ReadOnlyArray<any>, TReturn> = {
(...args: TArguments): TReturn,
/**
* An object for introspecting mock calls
Expand Down Expand Up @@ -620,7 +620,7 @@ interface JestExpectType {
* Use .toBeInstanceOf(Class) to check that an object is an instance of a
* class.
*/
toBeInstanceOf(cls: Class<*>): void;
toBeInstanceOf(cls: Class<any>): void;
/**
* .toBeNull() is the same as .toBe(null) but the error messages are a bit
* nicer.
Expand Down Expand Up @@ -811,7 +811,7 @@ type JestObjectType = {
* Returns a new, unused mock function. Optionally takes a mock
* implementation.
*/
fn<TArguments: $ReadOnlyArray<*>, TReturn>(
fn<TArguments: $ReadOnlyArray<any>, TReturn>(
implementation?: (...args: TArguments) => TReturn
): JestMockFn<TArguments, TReturn>,
/**
Expand Down
48 changes: 36 additions & 12 deletions flow-typed/npm/jest_v26.x.x.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// flow-typed signature: 9a1f9054d272cf6383233b8bfb639f84
// flow-typed version: 4efeddffd8/jest_v26.x.x/flow_>=v0.104.x
// flow-typed signature: 681725d1525989df4ff4c352015f5c2b
// flow-typed version: 9a968c602c/jest_v26.x.x/flow_>=v0.201.x

type JestMockFn<TArguments: $ReadOnlyArray<*>, TReturn> = {
type JestMockFn<TArguments: $ReadOnlyArray<any>, TReturn> = {
(...args: TArguments): TReturn,
/**
* An object for introspecting mock calls
Expand Down Expand Up @@ -259,6 +259,9 @@ type DomTestingLibraryType = {
// 5.x
toHaveDisplayValue(value: string | string[]): void,
toBeChecked(): void,
toBeEmptyDOMElement(): void,
toBePartiallyChecked(): void,
toHaveDescription(text: string | RegExp): void,
...
};

Expand Down Expand Up @@ -624,7 +627,7 @@ interface JestExpectType {
* Use .toBeInstanceOf(Class) to check that an object is an instance of a
* class.
*/
toBeInstanceOf(cls: Class<*>): void;
toBeInstanceOf(cls: Class<any>): void;
/**
* .toBeNull() is the same as .toBe(null) but the error messages are a bit
* nicer.
Expand Down Expand Up @@ -801,6 +804,14 @@ type JestObjectType = {
* Returns the number of fake timers still left to run.
*/
getTimerCount(): number,
/**
* 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().
*/
setSystemTime(now?: number | Date): void,
/**
* The same as `mock` but not moved to the top of the expectation by
* babel-jest.
Expand All @@ -815,18 +826,22 @@ type JestObjectType = {
* Returns a new, unused mock function. Optionally takes a mock
* implementation.
*/
fn<TArguments: $ReadOnlyArray<*>, TReturn>(
fn<TArguments: $ReadOnlyArray<any>, TReturn>(
implementation?: (...args: TArguments) => TReturn,
): JestMockFn<TArguments, TReturn>,
/**
* Determines if the given function is a mocked function.
*/
isMockFunction(fn: Function): boolean,
/**
* Alias of `createMockFromModule`.
*/
genMockFromModule(moduleName: string): any,
/**
* Given the name of a module, use the automatic mocking system to generate a
* mocked version of the module for you.
*/
genMockFromModule(moduleName: string): any,
createMockFromModule(moduleName: string): any,
/**
* Mocks a module with an auto-mocked version when it is being required.
*
Expand All @@ -845,7 +860,7 @@ type JestObjectType = {
* Returns the actual module instead of a mock, bypassing all checks on
* whether the module should receive a mock implementation or not.
*/
requireActual(moduleName: string): any,
requireActual<T>(m: $Flow$ModuleRef<T> | string): T,
/**
* Returns a mock module instead of the actual module, bypassing all checks
* on whether the module should be required normally or not.
Expand Down Expand Up @@ -1032,11 +1047,20 @@ declare var it: {
* @param {Function} Test
* @param {number} Timeout for the test, in milliseconds.
*/
skip(
name: JestTestName,
fn?: (done: JestDoneFn) => ?Promise<mixed>,
timeout?: number,
): void,
skip: {|
(
name: JestTestName,
fn?: (done: JestDoneFn) => ?Promise<mixed>,
timeout?: number,
): void,
each(
...table: Array<Array<mixed> | mixed> | [Array<string>, string]
): (
name: JestTestName,
fn?: (...args: Array<any>) => ?Promise<mixed>,
timeout?: number,
) => void,
|},
/**
* Highlight planned tests in the summary output
*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"eslint-plugin-relay": "^1.8.3",
"eslint-plugin-rulesdir": "^0.2.0",
"eslint-plugin-unused-imports": "^2.0.0",
"flow-bin": "^0.185.2",
"flow-bin": "0.204.1",
"flow-copy-source": "^2.0.9",
"flow-interfaces-chrome": "^0.6.0",
"flow-typed": "^3.7.0",
Expand Down
1 change: 1 addition & 0 deletions packages/shared/__test_utils__/Recoil_TestingUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ function renderUnwrappedElements(
renderReactRoot(
div,
isStrictModeEnabled() ? (
// $FlowFixMe[incompatible-call]
<StrictMode>{elements}</StrictMode>
) : (
// $FlowFixMe[incompatible-call]
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2993,10 +2993,10 @@ flatted@^3.1.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2"
integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==

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

flow-copy-source@^2.0.9:
version "2.0.9"
Expand Down