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
This commit is contained in:
Rubén Norte
2023-06-13 16:36:04 -07:00
committed by Facebook GitHub Bot
parent 1e332b8630
commit b46992de8a
+4
View File
@@ -38,6 +38,10 @@ type JestMockFn<TArguments: $ReadOnlyArray<any>, TReturn> = {
* instantiated from this mock function.
*/
instances: Array<TReturn>,
/**
* An array that contains the contexts for all calls of the mock function.
*/
contexts: Array<mixed>,
/**
* An array that contains all the object results that have been
* returned by this mock function call