From d98fc9de2dcb06c931b9d43d3ac5c150b066ac85 Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Mon, 10 Mar 2025 15:19:38 -0700 Subject: [PATCH] Align internal and external definition of `describe` function from jest (#49934) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49934 The typing of internal version of jest and the libdef in react-native has diverged a bit. This diff aligns the typing for `describe` Changelog: [Internal] Reviewed By: gkz Differential Revision: D70917375 fbshipit-source-id: 9c2ab98a08394aa187712f4966748a8a60e202b1 --- packages/react-native/flow/jest.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-native/flow/jest.js b/packages/react-native/flow/jest.js index 5841fe0e5af..fe6ae3cfd82 100644 --- a/packages/react-native/flow/jest.js +++ b/packages/react-native/flow/jest.js @@ -1040,10 +1040,12 @@ declare var describe: { * @param {table} table of Test */ each( - ...table: Array | mixed> | [Array, string] + ...table: + | $ReadOnlyArray<$ReadOnlyArray | mixed> + | [$ReadOnlyArray, string] ): ( name: JestTestName, - fn?: (...args: Array) => ?Promise, + fn?: (...args: $ReadOnlyArray) => ?Promise, timeout?: number, ) => void, ...