@testing-library/react-native 11.3.0 → 11.4.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 +3 -0
- package/build/act.js +9 -15
- package/build/act.js.map +1 -1
- package/build/cleanup.js +0 -4
- package/build/cleanup.js.map +1 -1
- package/build/config.d.ts +5 -0
- package/build/config.js +4 -5
- package/build/config.js.map +1 -1
- package/build/fireEvent.js +3 -31
- package/build/fireEvent.js.map +1 -1
- package/build/flushMicroTasks.js +0 -3
- package/build/flushMicroTasks.js.map +1 -1
- package/build/helpers/accessiblity.d.ts +3 -0
- package/build/helpers/accessiblity.js +14 -20
- package/build/helpers/accessiblity.js.map +1 -1
- package/build/helpers/component-tree.js +6 -27
- package/build/helpers/component-tree.js.map +1 -1
- package/build/helpers/debugDeep.d.ts +5 -1
- package/build/helpers/debugDeep.js +7 -6
- package/build/helpers/debugDeep.js.map +1 -1
- package/build/helpers/debugShallow.js +0 -5
- package/build/helpers/debugShallow.js.map +1 -1
- package/build/helpers/errors.js +4 -25
- package/build/helpers/errors.js.map +1 -1
- package/build/helpers/filterNodeByType.js +0 -2
- package/build/helpers/filterNodeByType.js.map +1 -1
- package/build/helpers/format.d.ts +5 -1
- package/build/helpers/format.js +17 -7
- package/build/helpers/format.js.map +1 -1
- package/build/helpers/matchers/accessibilityState.d.ts +3 -0
- package/build/helpers/matchers/accessibilityState.js +28 -0
- package/build/helpers/matchers/accessibilityState.js.map +1 -0
- package/build/helpers/matchers/matchArrayProp.js +0 -3
- package/build/helpers/matchers/matchArrayProp.js.map +1 -1
- package/build/helpers/matchers/matchObjectProp.js +0 -2
- package/build/helpers/matchers/matchObjectProp.js.map +1 -1
- package/build/helpers/matchers/matchStringProp.js +0 -3
- package/build/helpers/matchers/matchStringProp.js.map +1 -1
- package/build/helpers/stringValidation.js +0 -7
- package/build/helpers/stringValidation.js.map +1 -1
- package/build/helpers/timers.js +10 -21
- package/build/helpers/timers.js.map +1 -1
- package/build/index.flow.js +66 -21
- package/build/index.js +0 -6
- package/build/index.js.map +1 -1
- package/build/matches.js +2 -4
- package/build/matches.js.map +1 -1
- package/build/pure.js +0 -13
- package/build/pure.js.map +1 -1
- package/build/queries/a11yState.js +15 -13
- package/build/queries/a11yState.js.map +1 -1
- package/build/queries/a11yValue.js +0 -8
- package/build/queries/a11yValue.js.map +1 -1
- package/build/queries/displayValue.js +0 -11
- package/build/queries/displayValue.js.map +1 -1
- package/build/queries/hintText.d.ts +19 -18
- package/build/queries/hintText.js +10 -11
- package/build/queries/hintText.js.map +1 -1
- package/build/queries/labelText.d.ts +7 -6
- package/build/queries/labelText.js +10 -11
- package/build/queries/labelText.js.map +1 -1
- package/build/queries/makeQueries.d.ts +3 -3
- package/build/queries/makeQueries.js +40 -24
- package/build/queries/makeQueries.js.map +1 -1
- package/build/queries/placeholderText.js +0 -11
- package/build/queries/placeholderText.js.map +1 -1
- package/build/queries/role.d.ts +3 -2
- package/build/queries/role.js +23 -13
- package/build/queries/role.js.map +1 -1
- package/build/queries/testId.js +0 -9
- package/build/queries/testId.js.map +1 -1
- package/build/queries/text.js +0 -24
- package/build/queries/text.js.map +1 -1
- package/build/queries/unsafeProps.js +2 -11
- package/build/queries/unsafeProps.js.map +1 -1
- package/build/queries/unsafeType.js +2 -9
- package/build/queries/unsafeType.js.map +1 -1
- package/build/react-versions.js +0 -4
- package/build/react-versions.js.map +1 -1
- package/build/render.d.ts +32 -31
- package/build/render.js +21 -31
- package/build/render.js.map +1 -1
- package/build/renderHook.js +2 -12
- package/build/renderHook.js.map +1 -1
- package/build/screen.js +0 -6
- package/build/screen.js.map +1 -1
- package/build/shallow.js +0 -6
- package/build/shallow.js.map +1 -1
- package/build/waitFor.js +29 -52
- package/build/waitFor.js.map +1 -1
- package/build/waitForElementToBeRemoved.js +2 -11
- package/build/waitForElementToBeRemoved.js.map +1 -1
- package/build/within.d.ts +30 -30
- package/build/within.js +2 -14
- package/build/within.js.map +1 -1
- package/package.json +9 -8
- package/typings/index.flow.js +66 -21
package/build/within.d.ts
CHANGED
|
@@ -103,46 +103,46 @@ export declare function within(instance: ReactTestInstance): {
|
|
|
103
103
|
findAllByAccessibilityState: import("./queries/makeQueries").FindAllByQuery<import("react-native").AccessibilityState, void>;
|
|
104
104
|
getByRole: import("./queries/makeQueries").GetByQuery<import("./matches").TextMatch, {
|
|
105
105
|
name?: import("./matches").TextMatch | undefined;
|
|
106
|
-
}>;
|
|
106
|
+
} & import("react-native").AccessibilityState>;
|
|
107
107
|
getAllByRole: import("./queries/makeQueries").GetAllByQuery<import("./matches").TextMatch, {
|
|
108
108
|
name?: import("./matches").TextMatch | undefined;
|
|
109
|
-
}>;
|
|
109
|
+
} & import("react-native").AccessibilityState>;
|
|
110
110
|
queryByRole: import("./queries/makeQueries").QueryByQuery<import("./matches").TextMatch, {
|
|
111
111
|
name?: import("./matches").TextMatch | undefined;
|
|
112
|
-
}>;
|
|
112
|
+
} & import("react-native").AccessibilityState>;
|
|
113
113
|
queryAllByRole: import("./queries/makeQueries").QueryAllByQuery<import("./matches").TextMatch, {
|
|
114
114
|
name?: import("./matches").TextMatch | undefined;
|
|
115
|
-
}>;
|
|
115
|
+
} & import("react-native").AccessibilityState>;
|
|
116
116
|
findByRole: import("./queries/makeQueries").FindByQuery<import("./matches").TextMatch, {
|
|
117
117
|
name?: import("./matches").TextMatch | undefined;
|
|
118
|
-
}>;
|
|
118
|
+
} & import("react-native").AccessibilityState>;
|
|
119
119
|
findAllByRole: import("./queries/makeQueries").FindAllByQuery<import("./matches").TextMatch, {
|
|
120
120
|
name?: import("./matches").TextMatch | undefined;
|
|
121
|
-
}>;
|
|
122
|
-
getByHintText: import("./queries/makeQueries").GetByQuery<import("./matches").TextMatch,
|
|
123
|
-
getAllByHintText: import("./queries/makeQueries").GetAllByQuery<import("./matches").TextMatch,
|
|
124
|
-
queryByHintText: import("./queries/makeQueries").QueryByQuery<import("./matches").TextMatch,
|
|
125
|
-
queryAllByHintText: import("./queries/makeQueries").QueryAllByQuery<import("./matches").TextMatch,
|
|
126
|
-
findByHintText: import("./queries/makeQueries").FindByQuery<import("./matches").TextMatch,
|
|
127
|
-
findAllByHintText: import("./queries/makeQueries").FindAllByQuery<import("./matches").TextMatch,
|
|
128
|
-
getByA11yHint: import("./queries/makeQueries").GetByQuery<import("./matches").TextMatch,
|
|
129
|
-
getAllByA11yHint: import("./queries/makeQueries").GetAllByQuery<import("./matches").TextMatch,
|
|
130
|
-
queryByA11yHint: import("./queries/makeQueries").QueryByQuery<import("./matches").TextMatch,
|
|
131
|
-
queryAllByA11yHint: import("./queries/makeQueries").QueryAllByQuery<import("./matches").TextMatch,
|
|
132
|
-
findByA11yHint: import("./queries/makeQueries").FindByQuery<import("./matches").TextMatch,
|
|
133
|
-
findAllByA11yHint: import("./queries/makeQueries").FindAllByQuery<import("./matches").TextMatch,
|
|
134
|
-
getByAccessibilityHint: import("./queries/makeQueries").GetByQuery<import("./matches").TextMatch,
|
|
135
|
-
getAllByAccessibilityHint: import("./queries/makeQueries").GetAllByQuery<import("./matches").TextMatch,
|
|
136
|
-
queryByAccessibilityHint: import("./queries/makeQueries").QueryByQuery<import("./matches").TextMatch,
|
|
137
|
-
queryAllByAccessibilityHint: import("./queries/makeQueries").QueryAllByQuery<import("./matches").TextMatch,
|
|
138
|
-
findByAccessibilityHint: import("./queries/makeQueries").FindByQuery<import("./matches").TextMatch,
|
|
139
|
-
findAllByAccessibilityHint: import("./queries/makeQueries").FindAllByQuery<import("./matches").TextMatch,
|
|
140
|
-
getByLabelText: import("./queries/makeQueries").GetByQuery<import("./matches").TextMatch,
|
|
141
|
-
getAllByLabelText: import("./queries/makeQueries").GetAllByQuery<import("./matches").TextMatch,
|
|
142
|
-
queryByLabelText: import("./queries/makeQueries").QueryByQuery<import("./matches").TextMatch,
|
|
143
|
-
queryAllByLabelText: import("./queries/makeQueries").QueryAllByQuery<import("./matches").TextMatch,
|
|
144
|
-
findByLabelText: import("./queries/makeQueries").FindByQuery<import("./matches").TextMatch,
|
|
145
|
-
findAllByLabelText: import("./queries/makeQueries").FindAllByQuery<import("./matches").TextMatch,
|
|
121
|
+
} & import("react-native").AccessibilityState>;
|
|
122
|
+
getByHintText: import("./queries/makeQueries").GetByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
123
|
+
getAllByHintText: import("./queries/makeQueries").GetAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
124
|
+
queryByHintText: import("./queries/makeQueries").QueryByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
125
|
+
queryAllByHintText: import("./queries/makeQueries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
126
|
+
findByHintText: import("./queries/makeQueries").FindByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
127
|
+
findAllByHintText: import("./queries/makeQueries").FindAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
128
|
+
getByA11yHint: import("./queries/makeQueries").GetByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
129
|
+
getAllByA11yHint: import("./queries/makeQueries").GetAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
130
|
+
queryByA11yHint: import("./queries/makeQueries").QueryByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
131
|
+
queryAllByA11yHint: import("./queries/makeQueries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
132
|
+
findByA11yHint: import("./queries/makeQueries").FindByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
133
|
+
findAllByA11yHint: import("./queries/makeQueries").FindAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
134
|
+
getByAccessibilityHint: import("./queries/makeQueries").GetByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
135
|
+
getAllByAccessibilityHint: import("./queries/makeQueries").GetAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
136
|
+
queryByAccessibilityHint: import("./queries/makeQueries").QueryByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
137
|
+
queryAllByAccessibilityHint: import("./queries/makeQueries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
138
|
+
findByAccessibilityHint: import("./queries/makeQueries").FindByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
139
|
+
findAllByAccessibilityHint: import("./queries/makeQueries").FindAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
140
|
+
getByLabelText: import("./queries/makeQueries").GetByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
141
|
+
getAllByLabelText: import("./queries/makeQueries").GetAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
142
|
+
queryByLabelText: import("./queries/makeQueries").QueryByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
143
|
+
queryAllByLabelText: import("./queries/makeQueries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
144
|
+
findByLabelText: import("./queries/makeQueries").FindByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
145
|
+
findAllByLabelText: import("./queries/makeQueries").FindAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
146
146
|
getByPlaceholderText: import("./queries/makeQueries").GetByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
147
147
|
getAllByPlaceholderText: import("./queries/makeQueries").GetAllByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
|
148
148
|
queryByPlaceholderText: import("./queries/makeQueries").QueryByQuery<import("./matches").TextMatch, import("./queries/text").TextMatchOptions>;
|
package/build/within.js
CHANGED
|
@@ -5,31 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getQueriesForElement = void 0;
|
|
7
7
|
exports.within = within;
|
|
8
|
-
|
|
9
8
|
var _text = require("./queries/text");
|
|
10
|
-
|
|
11
9
|
var _testId = require("./queries/testId");
|
|
12
|
-
|
|
13
10
|
var _displayValue = require("./queries/displayValue");
|
|
14
|
-
|
|
15
11
|
var _placeholderText = require("./queries/placeholderText");
|
|
16
|
-
|
|
17
12
|
var _labelText = require("./queries/labelText");
|
|
18
|
-
|
|
19
13
|
var _hintText = require("./queries/hintText");
|
|
20
|
-
|
|
21
14
|
var _role = require("./queries/role");
|
|
22
|
-
|
|
23
15
|
var _a11yState = require("./queries/a11yState");
|
|
24
|
-
|
|
25
16
|
var _a11yValue = require("./queries/a11yValue");
|
|
26
|
-
|
|
27
17
|
var _unsafeType = require("./queries/unsafeType");
|
|
28
|
-
|
|
29
18
|
var _unsafeProps = require("./queries/unsafeProps");
|
|
30
|
-
|
|
31
19
|
function within(instance) {
|
|
32
|
-
return {
|
|
20
|
+
return {
|
|
21
|
+
...(0, _text.bindByTextQueries)(instance),
|
|
33
22
|
...(0, _testId.bindByTestIdQueries)(instance),
|
|
34
23
|
...(0, _displayValue.bindByDisplayValueQueries)(instance),
|
|
35
24
|
...(0, _placeholderText.bindByPlaceholderTextQueries)(instance),
|
|
@@ -42,7 +31,6 @@ function within(instance) {
|
|
|
42
31
|
...(0, _unsafeProps.bindUnsafeByPropsQueries)(instance)
|
|
43
32
|
};
|
|
44
33
|
}
|
|
45
|
-
|
|
46
34
|
const getQueriesForElement = within;
|
|
47
35
|
exports.getQueriesForElement = getQueriesForElement;
|
|
48
36
|
//# sourceMappingURL=within.js.map
|
package/build/within.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"within.js","names":["within","instance","bindByTextQueries","bindByTestIdQueries","bindByDisplayValueQueries","bindByPlaceholderTextQueries","bindByLabelTextQueries","bindByHintTextQueries","bindByRoleQueries","bindByA11yStateQueries","bindByA11yValueQueries","bindUnsafeByTypeQueries","bindUnsafeByPropsQueries","getQueriesForElement"],"sources":["../src/within.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { bindByTextQueries } from './queries/text';\nimport { bindByTestIdQueries } from './queries/testId';\nimport { bindByDisplayValueQueries } from './queries/displayValue';\nimport { bindByPlaceholderTextQueries } from './queries/placeholderText';\nimport { bindByLabelTextQueries } from './queries/labelText';\nimport { bindByHintTextQueries } from './queries/hintText';\nimport { bindByRoleQueries } from './queries/role';\nimport { bindByA11yStateQueries } from './queries/a11yState';\nimport { bindByA11yValueQueries } from './queries/a11yValue';\nimport { bindUnsafeByTypeQueries } from './queries/unsafeType';\nimport { bindUnsafeByPropsQueries } from './queries/unsafeProps';\n\nexport function within(instance: ReactTestInstance) {\n return {\n ...bindByTextQueries(instance),\n ...bindByTestIdQueries(instance),\n ...bindByDisplayValueQueries(instance),\n ...bindByPlaceholderTextQueries(instance),\n ...bindByLabelTextQueries(instance),\n ...bindByHintTextQueries(instance),\n ...bindByRoleQueries(instance),\n ...bindByA11yStateQueries(instance),\n ...bindByA11yValueQueries(instance),\n ...bindUnsafeByTypeQueries(instance),\n ...bindUnsafeByPropsQueries(instance),\n };\n}\n\nexport const getQueriesForElement = within;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"within.js","names":["within","instance","bindByTextQueries","bindByTestIdQueries","bindByDisplayValueQueries","bindByPlaceholderTextQueries","bindByLabelTextQueries","bindByHintTextQueries","bindByRoleQueries","bindByA11yStateQueries","bindByA11yValueQueries","bindUnsafeByTypeQueries","bindUnsafeByPropsQueries","getQueriesForElement"],"sources":["../src/within.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { bindByTextQueries } from './queries/text';\nimport { bindByTestIdQueries } from './queries/testId';\nimport { bindByDisplayValueQueries } from './queries/displayValue';\nimport { bindByPlaceholderTextQueries } from './queries/placeholderText';\nimport { bindByLabelTextQueries } from './queries/labelText';\nimport { bindByHintTextQueries } from './queries/hintText';\nimport { bindByRoleQueries } from './queries/role';\nimport { bindByA11yStateQueries } from './queries/a11yState';\nimport { bindByA11yValueQueries } from './queries/a11yValue';\nimport { bindUnsafeByTypeQueries } from './queries/unsafeType';\nimport { bindUnsafeByPropsQueries } from './queries/unsafeProps';\n\nexport function within(instance: ReactTestInstance) {\n return {\n ...bindByTextQueries(instance),\n ...bindByTestIdQueries(instance),\n ...bindByDisplayValueQueries(instance),\n ...bindByPlaceholderTextQueries(instance),\n ...bindByLabelTextQueries(instance),\n ...bindByHintTextQueries(instance),\n ...bindByRoleQueries(instance),\n ...bindByA11yStateQueries(instance),\n ...bindByA11yValueQueries(instance),\n ...bindUnsafeByTypeQueries(instance),\n ...bindUnsafeByPropsQueries(instance),\n };\n}\n\nexport const getQueriesForElement = within;\n"],"mappings":";;;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEO,SAASA,MAAM,CAACC,QAA2B,EAAE;EAClD,OAAO;IACL,GAAG,IAAAC,uBAAiB,EAACD,QAAQ,CAAC;IAC9B,GAAG,IAAAE,2BAAmB,EAACF,QAAQ,CAAC;IAChC,GAAG,IAAAG,uCAAyB,EAACH,QAAQ,CAAC;IACtC,GAAG,IAAAI,6CAA4B,EAACJ,QAAQ,CAAC;IACzC,GAAG,IAAAK,iCAAsB,EAACL,QAAQ,CAAC;IACnC,GAAG,IAAAM,+BAAqB,EAACN,QAAQ,CAAC;IAClC,GAAG,IAAAO,uBAAiB,EAACP,QAAQ,CAAC;IAC9B,GAAG,IAAAQ,iCAAsB,EAACR,QAAQ,CAAC;IACnC,GAAG,IAAAS,iCAAsB,EAACT,QAAQ,CAAC;IACnC,GAAG,IAAAU,mCAAuB,EAACV,QAAQ,CAAC;IACpC,GAAG,IAAAW,qCAAwB,EAACX,QAAQ;EACtC,CAAC;AACH;AAEO,MAAMY,oBAAoB,GAAGb,MAAM;AAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testing-library/react-native",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.4.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",
|
|
@@ -36,26 +36,26 @@
|
|
|
36
36
|
"@babel/preset-typescript": "^7.18.6",
|
|
37
37
|
"@callstack/eslint-config": "^13.0.1",
|
|
38
38
|
"@testing-library/jest-native": "^5.0.0",
|
|
39
|
-
"@types/jest": "^29.0
|
|
39
|
+
"@types/jest": "^29.2.0",
|
|
40
40
|
"@types/react": "~18.0.18",
|
|
41
41
|
"@types/react-native": "~0.70.0",
|
|
42
42
|
"@types/react-test-renderer": "~18.0.0",
|
|
43
|
-
"babel-jest": "^29.
|
|
43
|
+
"babel-jest": "^29.2.2",
|
|
44
44
|
"conventional-changelog-cli": "^2.2.2",
|
|
45
45
|
"dedent": "^0.7.0",
|
|
46
46
|
"del-cli": "^5.0.0",
|
|
47
47
|
"eslint": "^8.21.0",
|
|
48
48
|
"flow-bin": "~0.170.0",
|
|
49
49
|
"flow-copy-source": "^2.0.9",
|
|
50
|
-
"jest": "^29.
|
|
50
|
+
"jest": "^29.2.2",
|
|
51
51
|
"react": "18.1.0",
|
|
52
|
-
"react-native": "0.70.
|
|
52
|
+
"react-native": "0.70.4",
|
|
53
53
|
"react-test-renderer": "18.1.0",
|
|
54
54
|
"strip-ansi": "^6.0.0",
|
|
55
55
|
"typescript": "^4.0.2"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"pretty-format": "^29.0.
|
|
58
|
+
"pretty-format": "^29.0.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"jest": ">=28.0.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"scripts": {
|
|
72
72
|
"clean": "del build",
|
|
73
73
|
"test": "jest",
|
|
74
|
-
"test:ci": "jest --maxWorkers=2",
|
|
74
|
+
"test:ci": "jest --maxWorkers=2 --collectCoverage=true --coverage-provider=v8",
|
|
75
75
|
"test:ci:react:17": "scripts/test_react_17",
|
|
76
76
|
"typecheck": "tsc",
|
|
77
77
|
"flow": "flow",
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"testTimeout": 60000,
|
|
98
98
|
"transformIgnorePatterns": [
|
|
99
99
|
"/node_modules/(?!(@react-native|react-native)/).*/"
|
|
100
|
-
]
|
|
100
|
+
],
|
|
101
|
+
"clearMocks": true
|
|
101
102
|
}
|
|
102
103
|
}
|
package/typings/index.flow.js
CHANGED
|
@@ -203,48 +203,82 @@ interface UnsafeByPropsQueries {
|
|
|
203
203
|
| [];
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
type ByRoleOptions = {
|
|
207
|
+
...A11yState,
|
|
208
|
+
name?: string,
|
|
209
|
+
};
|
|
209
210
|
|
|
210
211
|
interface A11yAPI {
|
|
211
212
|
// Label
|
|
212
|
-
getByLabelText: (matcher: TextMatch) => GetReturn;
|
|
213
|
-
getAllByLabelText: (
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
getByLabelText: (matcher: TextMatch, options?: TextMatchOptions) => GetReturn;
|
|
214
|
+
getAllByLabelText: (
|
|
215
|
+
matcher: TextMatch,
|
|
216
|
+
options?: TextMatchOptions
|
|
217
|
+
) => GetAllReturn;
|
|
218
|
+
queryByLabelText: (
|
|
219
|
+
matcher: TextMatch,
|
|
220
|
+
options?: TextMatchOptions
|
|
221
|
+
) => QueryReturn;
|
|
222
|
+
queryAllByLabelText: (
|
|
223
|
+
matcher: TextMatch,
|
|
224
|
+
options?: TextMatchOptions
|
|
225
|
+
) => QueryAllReturn;
|
|
216
226
|
findByLabelText: (
|
|
217
227
|
matcher: TextMatch,
|
|
228
|
+
queryOptions?: TextMatchOptions,
|
|
218
229
|
waitForOptions?: WaitForOptions
|
|
219
230
|
) => FindReturn;
|
|
220
231
|
findAllByLabelText: (
|
|
221
232
|
matcher: TextMatch,
|
|
233
|
+
queryOptions?: TextMatchOptions,
|
|
222
234
|
waitForOptions?: WaitForOptions
|
|
223
235
|
) => FindAllReturn;
|
|
224
236
|
|
|
225
237
|
// Hint
|
|
226
|
-
getByA11yHint: (matcher: TextMatch) => GetReturn;
|
|
227
|
-
getByHintText: (matcher: TextMatch) => GetReturn;
|
|
228
|
-
getAllByA11yHint: (
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
238
|
+
getByA11yHint: (matcher: TextMatch, options?: TextMatchOptions) => GetReturn;
|
|
239
|
+
getByHintText: (matcher: TextMatch, options?: TextMatchOptions) => GetReturn;
|
|
240
|
+
getAllByA11yHint: (
|
|
241
|
+
matcher: TextMatch,
|
|
242
|
+
options?: TextMatchOptions
|
|
243
|
+
) => GetAllReturn;
|
|
244
|
+
getAllByHintText: (
|
|
245
|
+
matcher: TextMatch,
|
|
246
|
+
options?: TextMatchOptions
|
|
247
|
+
) => GetAllReturn;
|
|
248
|
+
queryByA11yHint: (
|
|
249
|
+
matcher: TextMatch,
|
|
250
|
+
options?: TextMatchOptions
|
|
251
|
+
) => QueryReturn;
|
|
252
|
+
queryByHintText: (
|
|
253
|
+
matcher: TextMatch,
|
|
254
|
+
options?: TextMatchOptions
|
|
255
|
+
) => QueryReturn;
|
|
256
|
+
queryAllByA11yHint: (
|
|
257
|
+
matcher: TextMatch,
|
|
258
|
+
options?: TextMatchOptions
|
|
259
|
+
) => QueryAllReturn;
|
|
260
|
+
queryAllByHintText: (
|
|
261
|
+
matcher: TextMatch,
|
|
262
|
+
options?: TextMatchOptions
|
|
263
|
+
) => QueryAllReturn;
|
|
234
264
|
findByA11yHint: (
|
|
235
265
|
matcher: TextMatch,
|
|
266
|
+
queryOptions?: TextMatchOptions,
|
|
236
267
|
waitForOptions?: WaitForOptions
|
|
237
268
|
) => FindReturn;
|
|
238
269
|
findByHintText: (
|
|
239
270
|
matcher: TextMatch,
|
|
271
|
+
queryOptions?: TextMatchOptions,
|
|
240
272
|
waitForOptions?: WaitForOptions
|
|
241
273
|
) => FindReturn;
|
|
242
274
|
findAllByA11yHint: (
|
|
243
275
|
matcher: TextMatch,
|
|
276
|
+
queryOptions?: TextMatchOptions,
|
|
244
277
|
waitForOptions?: WaitForOptions
|
|
245
278
|
) => FindAllReturn;
|
|
246
279
|
findAllByHintText: (
|
|
247
280
|
matcher: TextMatch,
|
|
281
|
+
queryOptions?: TextMatchOptions,
|
|
248
282
|
waitForOptions?: WaitForOptions
|
|
249
283
|
) => FindAllReturn;
|
|
250
284
|
|
|
@@ -252,24 +286,24 @@ interface A11yAPI {
|
|
|
252
286
|
getByRole: (matcher: A11yRole | RegExp, role?: ByRoleOptions) => GetReturn;
|
|
253
287
|
getAllByRole: (
|
|
254
288
|
matcher: A11yRole | RegExp,
|
|
255
|
-
|
|
289
|
+
options?: ByRoleOptions
|
|
256
290
|
) => GetAllReturn;
|
|
257
291
|
queryByRole: (
|
|
258
292
|
matcher: A11yRole | RegExp,
|
|
259
|
-
|
|
293
|
+
options?: ByRoleOptions
|
|
260
294
|
) => QueryReturn;
|
|
261
295
|
queryAllByRole: (
|
|
262
296
|
matcher: A11yRole | RegExp,
|
|
263
|
-
|
|
297
|
+
options?: ByRoleOptions
|
|
264
298
|
) => QueryAllReturn;
|
|
265
299
|
findByRole: (
|
|
266
300
|
matcher: A11yRole | RegExp,
|
|
267
|
-
|
|
301
|
+
queryOptions?: ByRoleOptions,
|
|
268
302
|
waitForOptions?: WaitForOptions
|
|
269
303
|
) => FindReturn;
|
|
270
304
|
findAllByRole: (
|
|
271
305
|
matcher: A11yRole | RegExp,
|
|
272
|
-
|
|
306
|
+
queryOptions?: ByRoleOptions,
|
|
273
307
|
waitForOptions?: WaitForOptions
|
|
274
308
|
) => FindAllReturn;
|
|
275
309
|
|
|
@@ -306,8 +340,18 @@ interface Thenable {
|
|
|
306
340
|
then: (resolve: () => any, reject?: () => any) => any;
|
|
307
341
|
}
|
|
308
342
|
|
|
343
|
+
type MapPropsFunction = (
|
|
344
|
+
props: { [string]: mixed },
|
|
345
|
+
node: ReactTestRendererJSON
|
|
346
|
+
) => { [string]: mixed };
|
|
347
|
+
|
|
348
|
+
type DebugOptions = {
|
|
349
|
+
message?: string,
|
|
350
|
+
mapProps?: MapPropsFunction,
|
|
351
|
+
};
|
|
352
|
+
|
|
309
353
|
type Debug = {
|
|
310
|
-
(
|
|
354
|
+
(options?: DebugOptions | string): void,
|
|
311
355
|
shallow: (message?: string) => void,
|
|
312
356
|
};
|
|
313
357
|
|
|
@@ -370,6 +414,7 @@ declare module '@testing-library/react-native' {
|
|
|
370
414
|
|
|
371
415
|
declare interface Config {
|
|
372
416
|
asyncUtilTimeout: number;
|
|
417
|
+
defaultDebugOptions?: $Shape<DebugOptions>;
|
|
373
418
|
}
|
|
374
419
|
|
|
375
420
|
declare export var configure: (options: $Shape<Config>) => void;
|