@testing-library/react-native 9.0.0-alpha.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/build/act.d.ts +3 -0
- package/build/act.js +2 -1
- package/build/act.js.map +1 -0
- package/build/cleanup.d.ts +5 -0
- package/build/cleanup.js +3 -2
- package/build/cleanup.js.map +1 -0
- package/build/fireEvent.d.ts +8 -0
- package/build/fireEvent.js +2 -1
- package/build/fireEvent.js.map +1 -0
- package/build/flushMicroTasks.d.ts +5 -0
- package/build/flushMicroTasks.js +2 -12
- package/build/flushMicroTasks.js.map +1 -0
- package/build/helpers/a11yAPI.d.ts +66 -0
- package/build/helpers/a11yAPI.js +16 -15
- package/build/helpers/a11yAPI.js.map +1 -0
- package/build/helpers/byDisplayValue.d.ts +6 -0
- package/build/helpers/byDisplayValue.js +2 -1
- package/build/helpers/byDisplayValue.js.map +1 -0
- package/build/helpers/byPlaceholderText.d.ts +6 -0
- package/build/helpers/byPlaceholderText.js +2 -1
- package/build/helpers/byPlaceholderText.js.map +1 -0
- package/build/helpers/byTestId.d.ts +6 -0
- package/build/helpers/byTestId.js +2 -1
- package/build/helpers/byTestId.js.map +1 -0
- package/build/helpers/byText.d.ts +10 -0
- package/build/helpers/byText.js +8 -5
- package/build/helpers/byText.js.map +1 -0
- package/build/helpers/debugDeep.d.ts +5 -0
- package/build/helpers/debugDeep.js +4 -1
- package/build/helpers/debugDeep.js.map +1 -0
- package/build/helpers/debugShallow.d.ts +6 -0
- package/build/helpers/debugShallow.js +4 -7
- package/build/helpers/debugShallow.js.map +1 -0
- package/build/helpers/errors.d.ts +10 -0
- package/build/helpers/errors.js +29 -9
- package/build/helpers/errors.js.map +1 -0
- package/build/helpers/filterNodeByType.d.ts +3 -0
- package/build/helpers/filterNodeByType.js +2 -1
- package/build/helpers/filterNodeByType.js.map +1 -0
- package/build/helpers/findByAPI.d.ts +17 -0
- package/build/helpers/findByAPI.js +2 -1
- package/build/helpers/findByAPI.js.map +1 -0
- package/build/helpers/format.d.ts +3 -0
- package/build/helpers/format.js +4 -3
- package/build/helpers/format.js.map +1 -0
- package/build/helpers/getByAPI.d.ts +31 -0
- package/build/helpers/getByAPI.js +4 -19
- package/build/helpers/getByAPI.js.map +1 -0
- package/build/helpers/makeA11yQuery.d.ts +13 -0
- package/build/helpers/makeA11yQuery.js +2 -1
- package/build/helpers/makeA11yQuery.js.map +1 -0
- package/build/helpers/makeQueries.d.ts +20 -0
- package/build/helpers/makeQueries.js +6 -3
- package/build/helpers/makeQueries.js.map +1 -0
- package/build/helpers/queryByAPI.d.ts +39 -0
- package/build/helpers/queryByAPI.js +3 -8
- package/build/helpers/queryByAPI.js.map +1 -0
- package/build/helpers/timers.d.ts +6 -0
- package/build/helpers/timers.js +9 -6
- package/build/helpers/timers.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.flow.js +384 -0
- package/build/index.js +2 -1
- package/build/index.js.map +1 -0
- package/build/matches.d.ts +9 -0
- package/build/matches.js +3 -2
- package/build/matches.js.map +1 -0
- package/build/{pure.js.flow → pure.d.ts} +4 -8
- package/build/pure.js +14 -31
- package/build/pure.js.map +1 -0
- package/build/render.d.ts +145 -0
- package/build/render.js +14 -10
- package/build/render.js.map +1 -0
- package/build/renderHook.d.ts +17 -0
- package/build/renderHook.js +57 -0
- package/build/renderHook.js.map +1 -0
- package/build/shallow.d.ts +8 -0
- package/build/shallow.js +3 -9
- package/build/shallow.js.map +1 -0
- package/build/waitFor.d.ts +8 -0
- package/build/waitFor.js +32 -23
- package/build/waitFor.js.map +1 -0
- package/build/waitForElementToBeRemoved.d.ts +2 -0
- package/build/waitForElementToBeRemoved.js +2 -1
- package/build/waitForElementToBeRemoved.js.map +1 -0
- package/build/within.d.ts +127 -0
- package/build/within.js +3 -2
- package/build/within.js.map +1 -0
- package/package.json +25 -15
- package/typings/index.flow.js +384 -0
- package/build/act.js.flow +0 -9
- package/build/cleanup.js.flow +0 -13
- package/build/fireEvent.js.flow +0 -127
- package/build/flushMicroTasks.js.flow +0 -23
- package/build/helpers/a11yAPI.js.flow +0 -241
- package/build/helpers/byDisplayValue.js.flow +0 -66
- package/build/helpers/byPlaceholderText.js.flow +0 -62
- package/build/helpers/byTestId.js.flow +0 -50
- package/build/helpers/byText.js.flow +0 -104
- package/build/helpers/debugDeep.js.flow +0 -16
- package/build/helpers/debugShallow.js.flow +0 -20
- package/build/helpers/errors.js.flow +0 -82
- package/build/helpers/filterNodeByType.js.flow +0 -1
- package/build/helpers/findByAPI.js.flow +0 -76
- package/build/helpers/format.js.flow +0 -10
- package/build/helpers/getByAPI.js.flow +0 -157
- package/build/helpers/makeA11yQuery.js.flow +0 -98
- package/build/helpers/makeQueries.js.flow +0 -165
- package/build/helpers/queryByAPI.js.flow +0 -166
- package/build/helpers/timers.js.flow +0 -88
- package/build/index.js.flow +0 -18
- package/build/matches.js.flow +0 -41
- package/build/render.js.flow +0 -109
- package/build/shallow.js.flow +0 -26
- package/build/types.flow.js +0 -1
- package/build/types.flow.js.flow +0 -59
- package/build/waitFor.js.flow +0 -221
- package/build/waitForElementToBeRemoved.js.flow +0 -42
- package/build/within.js.flow +0 -18
- package/typings/index.d.ts +0 -432
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ReactTestInstance } from 'react-test-renderer';
|
|
3
|
+
export declare function within(instance: ReactTestInstance): {
|
|
4
|
+
getByLabelText: (label: import("./matches").TextMatch) => ReactTestInstance;
|
|
5
|
+
getAllByLabelText: (label: import("./matches").TextMatch) => ReactTestInstance[];
|
|
6
|
+
queryByLabelText: (label: import("./matches").TextMatch) => ReactTestInstance | null;
|
|
7
|
+
queryAllByLabelText: (label: import("./matches").TextMatch) => ReactTestInstance[];
|
|
8
|
+
findByLabelText: (label: import("./matches").TextMatch, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance>;
|
|
9
|
+
findAllByLabelText: (label: import("./matches").TextMatch, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance[]>;
|
|
10
|
+
getByA11yHint: (a11yHint: import("./matches").TextMatch) => ReactTestInstance;
|
|
11
|
+
getByHintText: (a11yHint: import("./matches").TextMatch) => ReactTestInstance;
|
|
12
|
+
getAllByA11yHint: (a11yHint: import("./matches").TextMatch) => ReactTestInstance[];
|
|
13
|
+
getAllByHintText: (a11yHint: import("./matches").TextMatch) => ReactTestInstance[];
|
|
14
|
+
queryByA11yHint: (a11yHint: import("./matches").TextMatch) => ReactTestInstance | null;
|
|
15
|
+
queryByHintText: (a11yHint: import("./matches").TextMatch) => ReactTestInstance | null;
|
|
16
|
+
queryAllByA11yHint: (a11yHint: import("./matches").TextMatch) => ReactTestInstance[];
|
|
17
|
+
queryAllByHintText: (a11yHint: import("./matches").TextMatch) => ReactTestInstance[];
|
|
18
|
+
findByA11yHint: (a11yHint: import("./matches").TextMatch, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance>;
|
|
19
|
+
findByHintText: (a11yHint: import("./matches").TextMatch, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance>;
|
|
20
|
+
findAllByA11yHint: (a11yHint: import("./matches").TextMatch, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance[]>;
|
|
21
|
+
findAllByHintText: (a11yHint: import("./matches").TextMatch, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance[]>;
|
|
22
|
+
getByRole: (role: RegExp | import("react-native").AccessibilityRole) => ReactTestInstance;
|
|
23
|
+
getAllByRole: (role: RegExp | import("react-native").AccessibilityRole) => ReactTestInstance[];
|
|
24
|
+
queryByRole: (role: RegExp | import("react-native").AccessibilityRole) => ReactTestInstance | null;
|
|
25
|
+
queryAllByRole: (role: RegExp | import("react-native").AccessibilityRole) => ReactTestInstance[];
|
|
26
|
+
findByRole: (role: import("react-native").AccessibilityRole, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance>;
|
|
27
|
+
findAllByRole: (role: import("react-native").AccessibilityRole, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance[]>;
|
|
28
|
+
getByA11yStates: (accessibilityStateKey: keyof import("react-native").AccessibilityState | (keyof import("react-native").AccessibilityState)[]) => ReactTestInstance;
|
|
29
|
+
getAllByA11yStates: (accessibilityStateKey: keyof import("react-native").AccessibilityState | (keyof import("react-native").AccessibilityState)[]) => ReactTestInstance[];
|
|
30
|
+
queryByA11yStates: (accessibilityStateKey: keyof import("react-native").AccessibilityState | (keyof import("react-native").AccessibilityState)[]) => ReactTestInstance | null;
|
|
31
|
+
queryAllByA11yStates: (accessibilityStateKey: keyof import("react-native").AccessibilityState | (keyof import("react-native").AccessibilityState)[]) => ReactTestInstance[];
|
|
32
|
+
findByA11yStates: (accessibilityStateKey: keyof import("react-native").AccessibilityState, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance>;
|
|
33
|
+
findAllByA11yStates: (accessibilityStateKey: keyof import("react-native").AccessibilityState, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance[]>;
|
|
34
|
+
getByA11yState: (accessibilityState: import("react-native").AccessibilityState) => ReactTestInstance;
|
|
35
|
+
getAllByA11yState: (accessibilityState: import("react-native").AccessibilityState) => ReactTestInstance[];
|
|
36
|
+
queryByA11yState: (accessibilityState: import("react-native").AccessibilityState) => ReactTestInstance | null;
|
|
37
|
+
queryAllByA11yState: (accessibilityState: import("react-native").AccessibilityState) => ReactTestInstance[];
|
|
38
|
+
findByA11yState: (accessibilityState: import("react-native").AccessibilityState, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance>;
|
|
39
|
+
findAllByA11yState: (accessibilityState: import("react-native").AccessibilityState, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance[]>;
|
|
40
|
+
getByA11yValue: (a11yValue: {
|
|
41
|
+
min?: number | undefined;
|
|
42
|
+
max?: number | undefined;
|
|
43
|
+
now?: number | undefined;
|
|
44
|
+
text?: string | undefined;
|
|
45
|
+
}) => ReactTestInstance;
|
|
46
|
+
getAllByA11yValue: (a11yValue: {
|
|
47
|
+
min?: number | undefined;
|
|
48
|
+
max?: number | undefined;
|
|
49
|
+
now?: number | undefined;
|
|
50
|
+
text?: string | undefined;
|
|
51
|
+
}) => ReactTestInstance[];
|
|
52
|
+
queryByA11yValue: (a11yValue: {
|
|
53
|
+
min?: number | undefined;
|
|
54
|
+
max?: number | undefined;
|
|
55
|
+
now?: number | undefined;
|
|
56
|
+
text?: string | undefined;
|
|
57
|
+
}) => ReactTestInstance | null;
|
|
58
|
+
queryAllByA11yValue: (a11yValue: {
|
|
59
|
+
min?: number | undefined;
|
|
60
|
+
max?: number | undefined;
|
|
61
|
+
now?: number | undefined;
|
|
62
|
+
text?: string | undefined;
|
|
63
|
+
}) => ReactTestInstance[];
|
|
64
|
+
findByA11yValue: (a11yValue: {
|
|
65
|
+
min?: number | undefined;
|
|
66
|
+
max?: number | undefined;
|
|
67
|
+
now?: number | undefined;
|
|
68
|
+
text?: string | undefined;
|
|
69
|
+
}, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance>;
|
|
70
|
+
findAllByA11yValue: (a11yValue: {
|
|
71
|
+
min?: number | undefined;
|
|
72
|
+
max?: number | undefined;
|
|
73
|
+
now?: number | undefined;
|
|
74
|
+
text?: string | undefined;
|
|
75
|
+
}, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance[]>;
|
|
76
|
+
findAllByDisplayValue: (value: import("./matches").TextMatch, queryOptions?: (import("./helpers/byText").TextMatchOptions & import("./waitFor").WaitForOptions) | undefined, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance[]>;
|
|
77
|
+
findAllByPlaceholder: () => void;
|
|
78
|
+
findAllByPlaceholderText: (placeholder: import("./matches").TextMatch, queryOptions?: (import("./helpers/byText").TextMatchOptions & import("./waitFor").WaitForOptions) | undefined, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance[]>;
|
|
79
|
+
findAllByTestId: (testId: import("./matches").TextMatch, queryOptions?: (import("./helpers/byText").TextMatchOptions & import("./waitFor").WaitForOptions) | undefined, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance[]>;
|
|
80
|
+
findAllByText: (text: import("./matches").TextMatch, queryOptions?: (import("./helpers/byText").TextMatchOptions & import("./waitFor").WaitForOptions) | undefined, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance[]>;
|
|
81
|
+
findByDisplayValue: (value: import("./matches").TextMatch, queryOptions?: (import("./helpers/byText").TextMatchOptions & import("./waitFor").WaitForOptions) | undefined, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance>;
|
|
82
|
+
findByPlaceholder: () => void;
|
|
83
|
+
findByPlaceholderText: (placeholder: import("./matches").TextMatch, queryOptions?: (import("./helpers/byText").TextMatchOptions & import("./waitFor").WaitForOptions) | undefined, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance>;
|
|
84
|
+
findByTestId: (testId: import("./matches").TextMatch, queryOptions?: (import("./helpers/byText").TextMatchOptions & import("./waitFor").WaitForOptions) | undefined, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance>;
|
|
85
|
+
findByText: (text: import("./matches").TextMatch, queryOptions?: (import("./helpers/byText").TextMatchOptions & import("./waitFor").WaitForOptions) | undefined, waitForOptions?: import("./waitFor").WaitForOptions | undefined) => Promise<ReactTestInstance>;
|
|
86
|
+
queryByText: (name: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance | null;
|
|
87
|
+
queryAllByText: (text: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance[];
|
|
88
|
+
queryByPlaceholderText: (placeholder: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance | null;
|
|
89
|
+
queryAllByPlaceholderText: (placeholder: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance[];
|
|
90
|
+
queryByDisplayValue: (value: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance | null;
|
|
91
|
+
queryAllByDisplayValue: (value: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance[];
|
|
92
|
+
queryByTestId: (testID: import("./matches").TextMatch) => ReactTestInstance | null;
|
|
93
|
+
queryAllByTestId: (testID: import("./matches").TextMatch) => ReactTestInstance[];
|
|
94
|
+
UNSAFE_queryByType: <P>(type: import("react").ComponentType<P>) => ReactTestInstance | null;
|
|
95
|
+
UNSAFE_queryAllByType: <P_1>(type: import("react").ComponentType<P_1>) => ReactTestInstance[];
|
|
96
|
+
UNSAFE_queryByProps: (props: {
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
}) => ReactTestInstance | null;
|
|
99
|
+
UNSAFE_queryAllByProps: (props: {
|
|
100
|
+
[key: string]: any;
|
|
101
|
+
}) => ReactTestInstance[];
|
|
102
|
+
queryByName: () => void;
|
|
103
|
+
queryByType: () => void;
|
|
104
|
+
queryByProps: () => void;
|
|
105
|
+
queryAllByName: () => void;
|
|
106
|
+
queryAllByType: () => void;
|
|
107
|
+
queryAllByProps: () => void;
|
|
108
|
+
queryByPlaceholder: () => void;
|
|
109
|
+
queryAllByPlaceholder: () => void;
|
|
110
|
+
getByText: (text: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance;
|
|
111
|
+
getByPlaceholderText: (placeholder: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance;
|
|
112
|
+
getByDisplayValue: (value: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance;
|
|
113
|
+
getByTestId: (testID: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance;
|
|
114
|
+
getAllByTestId: (testID: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance[];
|
|
115
|
+
getAllByText: (text: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance[];
|
|
116
|
+
getAllByPlaceholderText: (placeholder: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance[];
|
|
117
|
+
getAllByDisplayValue: (value: import("./matches").TextMatch, queryOptions?: import("./helpers/byText").TextMatchOptions | undefined) => ReactTestInstance[];
|
|
118
|
+
UNSAFE_getByType: <P_2>(type: import("react").ComponentType<P_2>) => ReactTestInstance;
|
|
119
|
+
UNSAFE_getAllByType: <P_3>(type: import("react").ComponentType<P_3>) => ReactTestInstance[];
|
|
120
|
+
UNSAFE_getByProps: (props: {
|
|
121
|
+
[key: string]: any;
|
|
122
|
+
}) => ReactTestInstance;
|
|
123
|
+
UNSAFE_getAllByProps: (props: {
|
|
124
|
+
[key: string]: any;
|
|
125
|
+
}) => ReactTestInstance[];
|
|
126
|
+
};
|
|
127
|
+
export declare const getQueriesForElement: typeof within;
|
package/build/within.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.within = within;
|
|
7
6
|
exports.getQueriesForElement = void 0;
|
|
7
|
+
exports.within = within;
|
|
8
8
|
|
|
9
9
|
var _getByAPI = require("./helpers/getByAPI");
|
|
10
10
|
|
|
@@ -23,4 +23,5 @@ function within(instance) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const getQueriesForElement = within;
|
|
26
|
-
exports.getQueriesForElement = getQueriesForElement;
|
|
26
|
+
exports.getQueriesForElement = getQueriesForElement;
|
|
27
|
+
//# sourceMappingURL=within.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/within.ts"],"names":["within","instance","getQueriesForElement"],"mappings":";;;;;;;;AACA;;AACA;;AACA;;AACA;;AAEO,SAASA,MAAT,CAAgBC,QAAhB,EAA6C;AAClD,SAAO,EACL,GAAG,wBAASA,QAAT,CADE;AAEL,OAAG,4BAAWA,QAAX,CAFE;AAGL,OAAG,0BAAUA,QAAV,CAHE;AAIL,OAAG,sBAAQA,QAAR;AAJE,GAAP;AAMD;;AAEM,MAAMC,oBAAoB,GAAGF,MAA7B","sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { getByAPI } from './helpers/getByAPI';\nimport { queryByAPI } from './helpers/queryByAPI';\nimport { findByAPI } from './helpers/findByAPI';\nimport { a11yAPI } from './helpers/a11yAPI';\n\nexport function within(instance: ReactTestInstance) {\n return {\n ...getByAPI(instance),\n ...queryByAPI(instance),\n ...findByAPI(instance),\n ...a11yAPI(instance),\n };\n}\n\nexport const getQueriesForElement = within;\n"],"file":"within.js"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testing-library/react-native",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.0",
|
|
4
4
|
"description": "Simple and complete React Native testing utilities that encourage good testing practices.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
|
-
"
|
|
6
|
+
"types": "build/index.d.ts",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://www.github.com/callstack/react-native-testing-library.git"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"build/",
|
|
23
23
|
"jest-preset/",
|
|
24
|
-
"typings/index.
|
|
24
|
+
"typings/index.flow.js",
|
|
25
25
|
"pure.js",
|
|
26
26
|
"dont-cleanup-after-each.js"
|
|
27
27
|
],
|
|
@@ -29,18 +29,23 @@
|
|
|
29
29
|
"@babel/cli": "^7.8.4",
|
|
30
30
|
"@babel/core": "^7.9.0",
|
|
31
31
|
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
|
32
|
+
"@babel/plugin-transform-flow-strip-types": "^7.16.0",
|
|
32
33
|
"@babel/preset-env": "^7.9.6",
|
|
33
34
|
"@babel/preset-flow": "^7.9.0",
|
|
34
35
|
"@babel/preset-react": "^7.9.4",
|
|
35
|
-
"@
|
|
36
|
+
"@babel/preset-typescript": "^7.16.0",
|
|
37
|
+
"@callstack/eslint-config": "^11.0.0",
|
|
36
38
|
"@release-it/conventional-changelog": "^2.0.0",
|
|
37
39
|
"@testing-library/jest-native": "~4.0.2",
|
|
40
|
+
"@types/jest": "^27.0.0",
|
|
38
41
|
"@types/react": "^17.0.0",
|
|
39
|
-
"@types/react-native": "^0.
|
|
42
|
+
"@types/react-native": "^0.66.6",
|
|
40
43
|
"@types/react-test-renderer": "^17.0.0",
|
|
41
44
|
"babel-jest": "^27.0.0",
|
|
42
45
|
"conventional-changelog-cli": "^2.0.11",
|
|
46
|
+
"cp-cli": "^2.0.0",
|
|
43
47
|
"dedent": "^0.7.0",
|
|
48
|
+
"del-cli": "^3.0.1",
|
|
44
49
|
"eslint": "^7.0.0",
|
|
45
50
|
"flow-bin": "^0.141.0",
|
|
46
51
|
"flow-copy-source": "^2.0.9",
|
|
@@ -61,25 +66,30 @@
|
|
|
61
66
|
"react-test-renderer": ">=16.0.0"
|
|
62
67
|
},
|
|
63
68
|
"scripts": {
|
|
69
|
+
"clean": "del build",
|
|
64
70
|
"test": "jest",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
71
|
+
"typecheck": "tsc",
|
|
72
|
+
"flow": "flow",
|
|
73
|
+
"copy-flowtypes": "cp typings/index.flow.js build",
|
|
67
74
|
"lint": "eslint src --cache",
|
|
68
75
|
"release": "release-it",
|
|
69
|
-
"prepublish": "yarn build
|
|
70
|
-
"
|
|
71
|
-
"build": "
|
|
76
|
+
"prepublish": "yarn build",
|
|
77
|
+
"build:js": "babel src --out-dir build --extensions \".js,.ts,.jsx,.tsx\" --source-maps --ignore \"**/__tests__/**\"",
|
|
78
|
+
"build:js:watch": "yarn build:js --watch",
|
|
79
|
+
"build:ts": "tsc --build tsconfig.release.json",
|
|
80
|
+
"build:ts:watch": "yarn build:ts --watch --preserveWatchOutput",
|
|
81
|
+
"build": "yarn clean && yarn build:js && yarn build:ts && yarn copy-flowtypes",
|
|
82
|
+
"prepare": "yarn build"
|
|
72
83
|
},
|
|
73
84
|
"jest": {
|
|
74
85
|
"preset": "../jest-preset",
|
|
75
|
-
"moduleFileExtensions": [
|
|
76
|
-
"js",
|
|
77
|
-
"json"
|
|
78
|
-
],
|
|
79
86
|
"rootDir": "./src",
|
|
80
87
|
"testPathIgnorePatterns": [
|
|
81
88
|
"timerUtils"
|
|
82
89
|
],
|
|
83
|
-
"testTimeout": 30000
|
|
90
|
+
"testTimeout": 30000,
|
|
91
|
+
"transformIgnorePatterns": [
|
|
92
|
+
"/node_modules/(?!(@react-native|react-native)/).*/"
|
|
93
|
+
]
|
|
84
94
|
}
|
|
85
95
|
}
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type GetReturn = ReactTestInstance;
|
|
5
|
+
type GetAllReturn = Array<ReactTestInstance>;
|
|
6
|
+
type QueryReturn = ReactTestInstance | null;
|
|
7
|
+
type QueryAllReturn = Array<ReactTestInstance> | [];
|
|
8
|
+
type FindReturn = Promise<ReactTestInstance>;
|
|
9
|
+
type FindAllReturn = Promise<ReactTestInstance[]>;
|
|
10
|
+
|
|
11
|
+
type TextMatch = string | RegExp;
|
|
12
|
+
|
|
13
|
+
declare type NormalizerFn = (textToNormalize: string) => string;
|
|
14
|
+
declare type NormalizerConfig = {
|
|
15
|
+
trim?: boolean,
|
|
16
|
+
collapseWhitespace?: boolean,
|
|
17
|
+
};
|
|
18
|
+
declare type TextMatchOptions = {
|
|
19
|
+
exact?: boolean,
|
|
20
|
+
normalizer?: NormalizerFn,
|
|
21
|
+
};
|
|
22
|
+
declare type A11yRole =
|
|
23
|
+
| 'none'
|
|
24
|
+
| 'button'
|
|
25
|
+
| 'link'
|
|
26
|
+
| 'search'
|
|
27
|
+
| 'image'
|
|
28
|
+
| 'keyboardkey'
|
|
29
|
+
| 'text'
|
|
30
|
+
| 'adjustable'
|
|
31
|
+
| 'imagebutton'
|
|
32
|
+
| 'header'
|
|
33
|
+
| 'summary'
|
|
34
|
+
| 'alert'
|
|
35
|
+
| 'checkbox'
|
|
36
|
+
| 'combobox'
|
|
37
|
+
| 'menu'
|
|
38
|
+
| 'menubar'
|
|
39
|
+
| 'menuitem'
|
|
40
|
+
| 'progressbar'
|
|
41
|
+
| 'radio'
|
|
42
|
+
| 'radiogroup'
|
|
43
|
+
| 'scrollbar'
|
|
44
|
+
| 'spinbutton'
|
|
45
|
+
| 'switch'
|
|
46
|
+
| 'tab'
|
|
47
|
+
| 'tablist'
|
|
48
|
+
| 'timer'
|
|
49
|
+
| 'toolbar';
|
|
50
|
+
|
|
51
|
+
declare type A11yState = {|
|
|
52
|
+
disabled?: boolean,
|
|
53
|
+
selected?: boolean,
|
|
54
|
+
checked?: boolean | 'mixed',
|
|
55
|
+
busy?: boolean,
|
|
56
|
+
expanded?: boolean,
|
|
57
|
+
|};
|
|
58
|
+
|
|
59
|
+
declare type A11yStates =
|
|
60
|
+
| 'disabled'
|
|
61
|
+
| 'selected'
|
|
62
|
+
| 'checked'
|
|
63
|
+
| 'unchecked'
|
|
64
|
+
| 'busy'
|
|
65
|
+
| 'expanded'
|
|
66
|
+
| 'collapsed'
|
|
67
|
+
| 'hasPopup';
|
|
68
|
+
|
|
69
|
+
declare type A11yValue = {
|
|
70
|
+
min?: number,
|
|
71
|
+
max?: number,
|
|
72
|
+
now?: number,
|
|
73
|
+
text?: string,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
interface GetByAPI {
|
|
77
|
+
getByText: (text: TextMatch, options?: TextMatchOptions) => ReactTestInstance;
|
|
78
|
+
getByPlaceholderText: (
|
|
79
|
+
placeholder: TextMatch,
|
|
80
|
+
options?: TextMatchOptions
|
|
81
|
+
) => ReactTestInstance;
|
|
82
|
+
getByDisplayValue: (
|
|
83
|
+
value: TextMatch,
|
|
84
|
+
options?: TextMatchOptions
|
|
85
|
+
) => ReactTestInstance;
|
|
86
|
+
getByTestId: (
|
|
87
|
+
testID: TextMatch,
|
|
88
|
+
options?: TextMatchOptions
|
|
89
|
+
) => ReactTestInstance;
|
|
90
|
+
getAllByTestId: (
|
|
91
|
+
testID: TextMatch,
|
|
92
|
+
options?: TextMatchOptions
|
|
93
|
+
) => Array<ReactTestInstance>;
|
|
94
|
+
getAllByText: (
|
|
95
|
+
text: TextMatch,
|
|
96
|
+
options?: TextMatchOptions
|
|
97
|
+
) => Array<ReactTestInstance>;
|
|
98
|
+
getAllByPlaceholderText: (
|
|
99
|
+
placeholder: TextMatch,
|
|
100
|
+
options?: TextMatchOptions
|
|
101
|
+
) => Array<ReactTestInstance>;
|
|
102
|
+
getAllByDisplayValue: (
|
|
103
|
+
value: TextMatch,
|
|
104
|
+
options?: TextMatchOptions
|
|
105
|
+
) => Array<ReactTestInstance>;
|
|
106
|
+
|
|
107
|
+
// Unsafe aliases
|
|
108
|
+
UNSAFE_getByType: <P>(type: React.ComponentType<P>) => ReactTestInstance;
|
|
109
|
+
UNSAFE_getAllByType: <P>(
|
|
110
|
+
type: React.ComponentType<P>
|
|
111
|
+
) => Array<ReactTestInstance>;
|
|
112
|
+
UNSAFE_getByProps: (props: { [string]: any }) => ReactTestInstance;
|
|
113
|
+
UNSAFE_getAllByProps: (props: { [string]: any }) => Array<ReactTestInstance>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
interface QueryByAPI {
|
|
117
|
+
queryByText: (
|
|
118
|
+
name: TextMatch,
|
|
119
|
+
options?: TextMatchOptions
|
|
120
|
+
) => ReactTestInstance | null;
|
|
121
|
+
queryByPlaceholderText: (
|
|
122
|
+
placeholder: TextMatch,
|
|
123
|
+
options?: TextMatchOptions
|
|
124
|
+
) => ReactTestInstance | null;
|
|
125
|
+
queryByDisplayValue: (
|
|
126
|
+
value: TextMatch,
|
|
127
|
+
options?: TextMatchOptions
|
|
128
|
+
) => ReactTestInstance | null;
|
|
129
|
+
queryByTestId: (testID: TextMatch) => ReactTestInstance | null;
|
|
130
|
+
queryAllByTestId: (testID: TextMatch) => Array<ReactTestInstance> | [];
|
|
131
|
+
queryAllByText: (
|
|
132
|
+
text: TextMatch,
|
|
133
|
+
options?: TextMatchOptions
|
|
134
|
+
) => Array<ReactTestInstance> | [];
|
|
135
|
+
queryAllByPlaceholderText: (
|
|
136
|
+
placeholder: TextMatch,
|
|
137
|
+
options?: TextMatchOptions
|
|
138
|
+
) => Array<ReactTestInstance> | [];
|
|
139
|
+
queryAllByDisplayValue: (
|
|
140
|
+
value: TextMatch,
|
|
141
|
+
options?: TextMatchOptions
|
|
142
|
+
) => Array<ReactTestInstance> | [];
|
|
143
|
+
|
|
144
|
+
// Unsafe aliases
|
|
145
|
+
UNSAFE_queryByType: <P>(
|
|
146
|
+
type: React.ComponentType<P>
|
|
147
|
+
) => ReactTestInstance | null;
|
|
148
|
+
UNSAFE_queryAllByType: <P>(
|
|
149
|
+
type: React.ComponentType<P>
|
|
150
|
+
) => Array<ReactTestInstance> | [];
|
|
151
|
+
UNSAFE_queryByProps: (props: { [string]: any }) => ReactTestInstance | null;
|
|
152
|
+
UNSAFE_queryAllByProps: (props: { [string]: any }) =>
|
|
153
|
+
| Array<ReactTestInstance>
|
|
154
|
+
| [];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
type WaitForOptions = {
|
|
158
|
+
timeout?: number,
|
|
159
|
+
interval?: number,
|
|
160
|
+
onTimeout?: (error: mixed) => Error,
|
|
161
|
+
};
|
|
162
|
+
type WaitForFunction = <T = any>(
|
|
163
|
+
expectation: () => T,
|
|
164
|
+
options?: WaitForOptions
|
|
165
|
+
) => Promise<T>;
|
|
166
|
+
|
|
167
|
+
interface FindByAPI {
|
|
168
|
+
findByText: (
|
|
169
|
+
text: TextMatch,
|
|
170
|
+
queryOptions?: TextMatchOptions,
|
|
171
|
+
waitForOptions?: WaitForOptions
|
|
172
|
+
) => FindReturn;
|
|
173
|
+
findByPlaceholderText: (
|
|
174
|
+
placeholder: TextMatch,
|
|
175
|
+
queryOptions?: TextMatchOptions,
|
|
176
|
+
waitForOptions?: WaitForOptions
|
|
177
|
+
) => FindReturn;
|
|
178
|
+
findByDisplayValue: (
|
|
179
|
+
value: TextMatch,
|
|
180
|
+
queryOptions?: TextMatchOptions,
|
|
181
|
+
waitForOptions?: WaitForOptions
|
|
182
|
+
) => FindReturn;
|
|
183
|
+
findByTestId: (
|
|
184
|
+
testID: TextMatch,
|
|
185
|
+
queryOptions?: TextMatchOptions,
|
|
186
|
+
waitForOptions?: WaitForOptions
|
|
187
|
+
) => FindReturn;
|
|
188
|
+
findAllByText: (
|
|
189
|
+
text: TextMatch,
|
|
190
|
+
queryOptions?: TextMatchOptions,
|
|
191
|
+
waitForOptions?: WaitForOptions
|
|
192
|
+
) => FindAllReturn;
|
|
193
|
+
findAllByPlaceholderText: (
|
|
194
|
+
placeholder: TextMatch,
|
|
195
|
+
queryOptions?: TextMatchOptions,
|
|
196
|
+
waitForOptions?: WaitForOptions
|
|
197
|
+
) => FindAllReturn;
|
|
198
|
+
findAllByDisplayValue: (
|
|
199
|
+
value: TextMatch,
|
|
200
|
+
queryOptions?: TextMatchOptions,
|
|
201
|
+
waitForOptions?: WaitForOptions
|
|
202
|
+
) => FindAllReturn;
|
|
203
|
+
findAllByTestId: (
|
|
204
|
+
testID: TextMatch,
|
|
205
|
+
queryOptions?: TextMatchOptions,
|
|
206
|
+
waitForOptions?: WaitForOptions
|
|
207
|
+
) => FindAllReturn;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
interface A11yAPI {
|
|
211
|
+
// Label
|
|
212
|
+
getByLabelText: (matcher: TextMatch) => GetReturn;
|
|
213
|
+
getAllByLabelText: (matcher: TextMatch) => GetAllReturn;
|
|
214
|
+
queryByLabelText: (matcher: TextMatch) => QueryReturn;
|
|
215
|
+
queryAllByLabelText: (matcher: TextMatch) => QueryAllReturn;
|
|
216
|
+
findByLabelText: (
|
|
217
|
+
matcher: TextMatch,
|
|
218
|
+
waitForOptions?: WaitForOptions
|
|
219
|
+
) => FindReturn;
|
|
220
|
+
findAllByLabelText: (
|
|
221
|
+
matcher: TextMatch,
|
|
222
|
+
waitForOptions?: WaitForOptions
|
|
223
|
+
) => FindAllReturn;
|
|
224
|
+
|
|
225
|
+
// Hint
|
|
226
|
+
getByA11yHint: (matcher: TextMatch) => GetReturn;
|
|
227
|
+
getByHintText: (matcher: TextMatch) => GetReturn;
|
|
228
|
+
getAllByA11yHint: (matcher: TextMatch) => GetAllReturn;
|
|
229
|
+
getAllByHintText: (matcher: TextMatch) => GetAllReturn;
|
|
230
|
+
queryByA11yHint: (matcher: TextMatch) => QueryReturn;
|
|
231
|
+
queryByHintText: (matcher: TextMatch) => QueryReturn;
|
|
232
|
+
queryAllByA11yHint: (matcher: TextMatch) => QueryAllReturn;
|
|
233
|
+
queryAllByHintText: (matcher: TextMatch) => QueryAllReturn;
|
|
234
|
+
findByA11yHint: (
|
|
235
|
+
matcher: TextMatch,
|
|
236
|
+
waitForOptions?: WaitForOptions
|
|
237
|
+
) => FindReturn;
|
|
238
|
+
findByHintText: (
|
|
239
|
+
matcher: TextMatch,
|
|
240
|
+
waitForOptions?: WaitForOptions
|
|
241
|
+
) => FindReturn;
|
|
242
|
+
findAllByA11yHint: (
|
|
243
|
+
matcher: TextMatch,
|
|
244
|
+
waitForOptions?: WaitForOptions
|
|
245
|
+
) => FindAllReturn;
|
|
246
|
+
findAllByHintText: (
|
|
247
|
+
matcher: TextMatch,
|
|
248
|
+
waitForOptions?: WaitForOptions
|
|
249
|
+
) => FindAllReturn;
|
|
250
|
+
|
|
251
|
+
// Role
|
|
252
|
+
getByRole: (matcher: A11yRole | RegExp) => GetReturn;
|
|
253
|
+
getAllByRole: (matcher: A11yRole | RegExp) => GetAllReturn;
|
|
254
|
+
queryByRole: (matcher: A11yRole | RegExp) => QueryReturn;
|
|
255
|
+
queryAllByRole: (matcher: A11yRole | RegExp) => QueryAllReturn;
|
|
256
|
+
findByRole: (
|
|
257
|
+
matcher: A11yRole | RegExp,
|
|
258
|
+
waitForOptions?: WaitForOptions
|
|
259
|
+
) => FindReturn;
|
|
260
|
+
findAllByRole: (
|
|
261
|
+
matcher: A11yRole | RegExp,
|
|
262
|
+
waitForOptions?: WaitForOptions
|
|
263
|
+
) => FindAllReturn;
|
|
264
|
+
|
|
265
|
+
// States
|
|
266
|
+
getByA11yStates: (matcher: A11yStates | Array<A11yStates>) => GetReturn;
|
|
267
|
+
getAllByA11yStates: (matcher: A11yStates | Array<A11yStates>) => GetAllReturn;
|
|
268
|
+
queryByA11yStates: (matcher: A11yStates | Array<A11yStates>) => QueryReturn;
|
|
269
|
+
queryAllByA11yStates: (
|
|
270
|
+
matcher: A11yStates | Array<A11yStates>
|
|
271
|
+
) => QueryAllReturn;
|
|
272
|
+
|
|
273
|
+
// State
|
|
274
|
+
getByA11yState: (matcher: A11yStates) => GetReturn;
|
|
275
|
+
getAllByA11yState: (matcher: A11yStates) => GetAllReturn;
|
|
276
|
+
queryByA11yState: (matcher: A11yStates) => QueryReturn;
|
|
277
|
+
queryAllByA11yState: (matcher: A11yStates) => QueryAllReturn;
|
|
278
|
+
findByA11yState: (
|
|
279
|
+
matcher: A11yStates,
|
|
280
|
+
waitForOptions?: WaitForOptions
|
|
281
|
+
) => FindReturn;
|
|
282
|
+
findAllByA11yState: (
|
|
283
|
+
matcher: A11yStates,
|
|
284
|
+
waitForOptions?: WaitForOptions
|
|
285
|
+
) => FindAllReturn;
|
|
286
|
+
|
|
287
|
+
// Value
|
|
288
|
+
getByA11yValue: (matcher: A11yValue) => GetReturn;
|
|
289
|
+
getAllByA11yValue: (matcher: A11yValue) => GetAllReturn;
|
|
290
|
+
queryByA11yValue: (matcher: A11yValue) => QueryReturn;
|
|
291
|
+
queryAllByA11yValue: (matcher: A11yValue) => QueryAllReturn;
|
|
292
|
+
findByA11yValue: (
|
|
293
|
+
matcher: A11yValue,
|
|
294
|
+
waitForOptions?: WaitForOptions
|
|
295
|
+
) => FindReturn;
|
|
296
|
+
findAllByA11yValue: (
|
|
297
|
+
matcher: A11yValue,
|
|
298
|
+
waitForOptions?: WaitForOptions
|
|
299
|
+
) => FindAllReturn;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
interface Thenable {
|
|
303
|
+
then: (resolve: () => any, reject?: () => any) => any;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
interface RenderOptions {
|
|
307
|
+
wrapper?: React.ComponentType<any>;
|
|
308
|
+
createNodeMock?: (element: React.Element<any>) => any;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
type Debug = {
|
|
312
|
+
(message?: string): void,
|
|
313
|
+
shallow: (message?: string) => void,
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
type Queries = GetByAPI & QueryByAPI & FindByAPI & A11yAPI;
|
|
317
|
+
|
|
318
|
+
interface RenderAPI extends Queries {
|
|
319
|
+
update(nextElement: React.Element<any>): void;
|
|
320
|
+
rerender(nextElement: React.Element<any>): void;
|
|
321
|
+
unmount(nextElement?: React.Element<any>): void;
|
|
322
|
+
toJSON(): ReactTestRendererJSON[] | ReactTestRendererJSON | null;
|
|
323
|
+
debug: Debug;
|
|
324
|
+
container: ReactTestInstance;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
type FireEventFunction = (
|
|
328
|
+
element: ReactTestInstance,
|
|
329
|
+
eventName: string,
|
|
330
|
+
...data: Array<any>
|
|
331
|
+
) => any;
|
|
332
|
+
|
|
333
|
+
type FireEventAPI = FireEventFunction & {
|
|
334
|
+
press: (element: ReactTestInstance, ...data: Array<any>) => any,
|
|
335
|
+
changeText: (element: ReactTestInstance, ...data: Array<any>) => any,
|
|
336
|
+
scroll: (element: ReactTestInstance, ...data: Array<any>) => any,
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
type RenderHookResult<Result, Props> = {
|
|
340
|
+
rerender: (props: Props) => void,
|
|
341
|
+
result: { current: Result },
|
|
342
|
+
unmount: () => void,
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
type RenderHookOptions<Props> = {
|
|
346
|
+
initialProps?: Props,
|
|
347
|
+
wrapper?: React.ComponentType<any>,
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
declare module '@testing-library/react-native' {
|
|
351
|
+
declare export var render: (
|
|
352
|
+
component: React.Element<any>,
|
|
353
|
+
options?: RenderOptions
|
|
354
|
+
) => RenderAPI;
|
|
355
|
+
|
|
356
|
+
declare export var cleanup: () => void;
|
|
357
|
+
declare export var fireEvent: FireEventAPI;
|
|
358
|
+
|
|
359
|
+
declare export var waitFor: WaitForFunction;
|
|
360
|
+
|
|
361
|
+
declare type WaitForElementToBeRemovedFunction = <T = any>(
|
|
362
|
+
expectation: () => T,
|
|
363
|
+
options?: WaitForOptions
|
|
364
|
+
) => Promise<T>;
|
|
365
|
+
|
|
366
|
+
declare export var waitForElementToBeRemoved: WaitForElementToBeRemovedFunction;
|
|
367
|
+
|
|
368
|
+
declare export var act: (callback: () => void) => Thenable;
|
|
369
|
+
declare export var within: (instance: ReactTestInstance) => Queries;
|
|
370
|
+
declare export var getQueriesForElement: (
|
|
371
|
+
instance: ReactTestInstance
|
|
372
|
+
) => Queries;
|
|
373
|
+
|
|
374
|
+
declare export var getDefaultNormalizer: (
|
|
375
|
+
normalizerConfig?: NormalizerConfig
|
|
376
|
+
) => NormalizerFn;
|
|
377
|
+
|
|
378
|
+
declare type RenderHookFunction = <Result, Props>(
|
|
379
|
+
renderCallback: (props: Props) => Result,
|
|
380
|
+
options?: RenderHookOptions<Props>
|
|
381
|
+
) => RenderHookResult<Result, Props>;
|
|
382
|
+
|
|
383
|
+
declare export var renderHook: RenderHookFunction;
|
|
384
|
+
}
|
package/build/act.js.flow
DELETED
package/build/cleanup.js.flow
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
let cleanupQueue = new Set();
|
|
3
|
-
|
|
4
|
-
export default function cleanup() {
|
|
5
|
-
cleanupQueue.forEach((fn) => fn());
|
|
6
|
-
cleanupQueue.clear();
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function addToCleanupQueue(
|
|
10
|
-
fn: (nextElement?: React$Element<any>) => void
|
|
11
|
-
) {
|
|
12
|
-
cleanupQueue.add(fn);
|
|
13
|
-
}
|