From b46992de8a45d8ba9d3ba7dc1c010524ce6a2cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Tue, 13 Jun 2023 16:36:04 -0700 Subject: [PATCH] Type mock.contexts correctly in Jest (#37847) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37847 Jest supports accessing the contexts used to call mock functions (the `this` value) but we're not typing that correctly in the definitions in React Native. This changes that. Changelog: [internal] Reviewed By: javache Differential Revision: D46684043 fbshipit-source-id: ff121e0726748788591e7d061a39fde238c1ddbe --- packages/react-native/flow/jest.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/flow/jest.js b/packages/react-native/flow/jest.js index 5f42ea1358f..505dd3fc163 100644 --- a/packages/react-native/flow/jest.js +++ b/packages/react-native/flow/jest.js @@ -38,6 +38,10 @@ type JestMockFn, TReturn> = { * instantiated from this mock function. */ instances: Array, + /** + * An array that contains the contexts for all calls of the mock function. + */ + contexts: Array, /** * An array that contains all the object results that have been * returned by this mock function call