@testing-library/react-native 11.2.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 +15 -0
- package/build/config.js +27 -0
- package/build/config.js.map +1 -0
- package/build/fireEvent.js +3 -33
- 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.d.ts +15 -0
- package/build/helpers/component-tree.js +49 -15
- 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 +11 -22
- package/build/helpers/timers.js.map +1 -1
- package/build/index.flow.js +74 -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.d.ts +2 -0
- package/build/pure.js +13 -12
- package/build/pure.js.map +1 -1
- package/build/queries/a11yState.d.ts +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 +7 -26
- 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 +6 -25
- 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 +21 -45
- 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 +31 -53
- 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 +18 -17
- package/typings/index.flow.js +74 -21
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
|
|
|
@@ -346,6 +390,7 @@ declare module '@testing-library/react-native' {
|
|
|
346
390
|
declare interface RenderOptions {
|
|
347
391
|
wrapper?: React.ComponentType<any>;
|
|
348
392
|
createNodeMock?: (element: React.Element<any>) => any;
|
|
393
|
+
unstable_validateStringsRenderedWithinText?: boolean;
|
|
349
394
|
}
|
|
350
395
|
|
|
351
396
|
declare export var render: (
|
|
@@ -367,6 +412,14 @@ declare module '@testing-library/react-native' {
|
|
|
367
412
|
|
|
368
413
|
declare export var waitForElementToBeRemoved: WaitForElementToBeRemovedFunction;
|
|
369
414
|
|
|
415
|
+
declare interface Config {
|
|
416
|
+
asyncUtilTimeout: number;
|
|
417
|
+
defaultDebugOptions?: $Shape<DebugOptions>;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
declare export var configure: (options: $Shape<Config>) => void;
|
|
421
|
+
declare export var resetToDefaults: () => void;
|
|
422
|
+
|
|
370
423
|
declare export var act: (callback: () => void) => Thenable;
|
|
371
424
|
declare export var within: (instance: ReactTestInstance) => Queries;
|
|
372
425
|
declare export var getQueriesForElement: (
|