@testing-library/react-native 14.0.0-alpha.0 → 14.0.0-alpha.2

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.
Files changed (233) hide show
  1. package/README.md +8 -12
  2. package/build/act.d.ts +2 -4
  3. package/build/act.js +4 -5
  4. package/build/act.js.map +1 -1
  5. package/build/cleanup.d.ts +3 -1
  6. package/build/cleanup.js +8 -0
  7. package/build/cleanup.js.map +1 -1
  8. package/build/event-handler.d.ts +7 -0
  9. package/build/event-handler.js +30 -0
  10. package/build/event-handler.js.map +1 -0
  11. package/build/fire-event.d.ts +11 -4
  12. package/build/fire-event.js +43 -37
  13. package/build/fire-event.js.map +1 -1
  14. package/build/helpers/accessibility.d.ts +2 -2
  15. package/build/helpers/accessibility.js +5 -2
  16. package/build/helpers/accessibility.js.map +1 -1
  17. package/build/helpers/component-tree.d.ts +8 -8
  18. package/build/helpers/component-tree.js +19 -16
  19. package/build/helpers/component-tree.js.map +1 -1
  20. package/build/helpers/debug.d.ts +3 -3
  21. package/build/helpers/debug.js +8 -11
  22. package/build/helpers/debug.js.map +1 -1
  23. package/build/helpers/errors.js +4 -4
  24. package/build/helpers/errors.js.map +1 -1
  25. package/build/helpers/find-all.d.ts +1 -1
  26. package/build/helpers/find-all.js +7 -27
  27. package/build/helpers/find-all.js.map +1 -1
  28. package/build/helpers/format-element.d.ts +18 -0
  29. package/build/helpers/format-element.js +80 -0
  30. package/build/helpers/format-element.js.map +1 -0
  31. package/build/helpers/host-component-names.d.ts +1 -1
  32. package/build/helpers/host-component-names.js +6 -7
  33. package/build/helpers/host-component-names.js.map +1 -1
  34. package/build/helpers/logger.d.ts +28 -0
  35. package/build/helpers/logger.js +42 -0
  36. package/build/helpers/logger.js.map +1 -0
  37. package/build/helpers/{format-default.d.ts → map-props.d.ts} +1 -0
  38. package/build/helpers/{format-default.js → map-props.js} +2 -2
  39. package/build/helpers/map-props.js.map +1 -0
  40. package/build/helpers/matchers/match-accessibility-state.d.ts +1 -1
  41. package/build/helpers/matchers/match-accessibility-state.js.map +1 -1
  42. package/build/helpers/matchers/match-accessibility-value.d.ts +2 -2
  43. package/build/helpers/matchers/match-accessibility-value.js.map +1 -1
  44. package/build/helpers/matchers/match-label-text.d.ts +2 -2
  45. package/build/helpers/matchers/match-label-text.js.map +1 -1
  46. package/build/helpers/matchers/match-string-prop.d.ts +1 -1
  47. package/build/helpers/matchers/match-string-prop.js.map +1 -1
  48. package/build/helpers/matchers/match-text-content.d.ts +2 -2
  49. package/build/helpers/matchers/match-text-content.js.map +1 -1
  50. package/build/helpers/object.d.ts +1 -1
  51. package/build/helpers/object.js.map +1 -1
  52. package/build/helpers/pointer-events.d.ts +1 -1
  53. package/build/helpers/pointer-events.js +9 -5
  54. package/build/helpers/pointer-events.js.map +1 -1
  55. package/build/helpers/text-content.d.ts +1 -1
  56. package/build/helpers/text-content.js.map +1 -1
  57. package/build/helpers/text-input.d.ts +1 -1
  58. package/build/helpers/text-input.js.map +1 -1
  59. package/build/helpers/timers.d.ts +1 -1
  60. package/build/helpers/timers.js.map +1 -1
  61. package/build/helpers/wrap-async.d.ts +0 -1
  62. package/build/helpers/wrap-async.js +0 -1
  63. package/build/helpers/wrap-async.js.map +1 -1
  64. package/build/index.d.ts +0 -1
  65. package/build/index.flow.js +33 -36
  66. package/build/index.js +4 -16
  67. package/build/index.js.map +1 -1
  68. package/build/matchers/extend-expect.js +2 -2
  69. package/build/matchers/extend-expect.js.map +1 -1
  70. package/build/matchers/index.d.ts +1 -1
  71. package/build/matchers/index.js.map +1 -1
  72. package/build/matchers/to-be-busy.d.ts +1 -1
  73. package/build/matchers/to-be-busy.js +4 -1
  74. package/build/matchers/to-be-busy.js.map +1 -1
  75. package/build/matchers/to-be-checked.d.ts +1 -1
  76. package/build/matchers/to-be-checked.js +4 -1
  77. package/build/matchers/to-be-checked.js.map +1 -1
  78. package/build/matchers/to-be-disabled.d.ts +1 -1
  79. package/build/matchers/to-be-disabled.js +5 -2
  80. package/build/matchers/to-be-disabled.js.map +1 -1
  81. package/build/matchers/to-be-empty-element.d.ts +1 -1
  82. package/build/matchers/to-be-empty-element.js +9 -3
  83. package/build/matchers/to-be-empty-element.js.map +1 -1
  84. package/build/matchers/to-be-expanded.d.ts +1 -1
  85. package/build/matchers/to-be-expanded.js +5 -2
  86. package/build/matchers/to-be-expanded.js.map +1 -1
  87. package/build/matchers/to-be-on-the-screen.d.ts +1 -1
  88. package/build/matchers/to-be-on-the-screen.js +4 -1
  89. package/build/matchers/to-be-on-the-screen.js.map +1 -1
  90. package/build/matchers/to-be-partially-checked.d.ts +1 -1
  91. package/build/matchers/to-be-partially-checked.js +4 -1
  92. package/build/matchers/to-be-partially-checked.js.map +1 -1
  93. package/build/matchers/to-be-selected.d.ts +1 -1
  94. package/build/matchers/to-be-selected.js +4 -1
  95. package/build/matchers/to-be-selected.js.map +1 -1
  96. package/build/matchers/to-be-visible.d.ts +1 -1
  97. package/build/matchers/to-be-visible.js +8 -5
  98. package/build/matchers/to-be-visible.js.map +1 -1
  99. package/build/matchers/to-contain-element.d.ts +1 -1
  100. package/build/matchers/to-contain-element.js +5 -3
  101. package/build/matchers/to-contain-element.js.map +1 -1
  102. package/build/matchers/to-have-accessibility-value.d.ts +2 -2
  103. package/build/matchers/to-have-accessibility-value.js.map +1 -1
  104. package/build/matchers/to-have-accessible-name.d.ts +2 -2
  105. package/build/matchers/to-have-accessible-name.js.map +1 -1
  106. package/build/matchers/to-have-display-value.d.ts +2 -2
  107. package/build/matchers/to-have-display-value.js +1 -1
  108. package/build/matchers/to-have-display-value.js.map +1 -1
  109. package/build/matchers/to-have-prop.d.ts +1 -1
  110. package/build/matchers/to-have-prop.js.map +1 -1
  111. package/build/matchers/to-have-style.d.ts +2 -2
  112. package/build/matchers/to-have-style.js +1 -1
  113. package/build/matchers/to-have-style.js.map +1 -1
  114. package/build/matchers/to-have-text-content.d.ts +2 -2
  115. package/build/matchers/to-have-text-content.js.map +1 -1
  116. package/build/matchers/types.d.ts +4 -4
  117. package/build/matchers/types.js.map +1 -1
  118. package/build/matchers/utils.d.ts +1 -8
  119. package/build/matchers/utils.js +3 -48
  120. package/build/matchers/utils.js.map +1 -1
  121. package/build/native-state.d.ts +3 -3
  122. package/build/native-state.js +1 -1
  123. package/build/native-state.js.map +1 -1
  124. package/build/pure.d.ts +6 -4
  125. package/build/pure.js +28 -2
  126. package/build/pure.js.map +1 -1
  127. package/build/queries/display-value.d.ts +3 -3
  128. package/build/queries/display-value.js +9 -9
  129. package/build/queries/display-value.js.map +1 -1
  130. package/build/queries/hint-text.d.ts +4 -4
  131. package/build/queries/hint-text.js +9 -9
  132. package/build/queries/hint-text.js.map +1 -1
  133. package/build/queries/label-text.d.ts +4 -4
  134. package/build/queries/label-text.js +9 -9
  135. package/build/queries/label-text.js.map +1 -1
  136. package/build/queries/make-queries.d.ts +3 -3
  137. package/build/queries/make-queries.js +15 -18
  138. package/build/queries/make-queries.js.map +1 -1
  139. package/build/queries/options.d.ts +1 -1
  140. package/build/queries/options.js.map +1 -1
  141. package/build/queries/placeholder-text.d.ts +3 -3
  142. package/build/queries/placeholder-text.js +10 -10
  143. package/build/queries/placeholder-text.js.map +1 -1
  144. package/build/queries/role.d.ts +7 -7
  145. package/build/queries/role.js +16 -9
  146. package/build/queries/role.js.map +1 -1
  147. package/build/queries/test-id.d.ts +3 -3
  148. package/build/queries/test-id.js +9 -9
  149. package/build/queries/test-id.js.map +1 -1
  150. package/build/queries/text.d.ts +3 -3
  151. package/build/queries/text.js +9 -9
  152. package/build/queries/text.js.map +1 -1
  153. package/build/react-versions.js +1 -2
  154. package/build/react-versions.js.map +1 -1
  155. package/build/render-act.d.ts +3 -0
  156. package/build/render-act.js +29 -0
  157. package/build/render-act.js.map +1 -0
  158. package/build/render-async.d.ts +83 -0
  159. package/build/render-async.js +96 -0
  160. package/build/render-async.js.map +1 -0
  161. package/build/render-hook.d.ts +18 -6
  162. package/build/render-hook.js +56 -26
  163. package/build/render-hook.js.map +1 -1
  164. package/build/render.d.ts +54 -48
  165. package/build/render.js +42 -30
  166. package/build/render.js.map +1 -1
  167. package/build/screen.d.ts +1 -1
  168. package/build/screen.js +7 -7
  169. package/build/screen.js.map +1 -1
  170. package/build/test-utils/console.d.ts +1 -0
  171. package/build/test-utils/console.js +17 -0
  172. package/build/test-utils/console.js.map +1 -0
  173. package/build/test-utils/json.d.ts +6 -0
  174. package/build/test-utils/json.js +33 -0
  175. package/build/test-utils/json.js.map +1 -0
  176. package/build/tsconfig.release.tsbuildinfo +1 -1
  177. package/build/types.d.ts +4 -0
  178. package/build/types.js.map +1 -1
  179. package/build/user-event/clear.d.ts +2 -2
  180. package/build/user-event/clear.js +6 -6
  181. package/build/user-event/clear.js.map +1 -1
  182. package/build/user-event/event-builder/base.d.ts +2 -2
  183. package/build/user-event/event-builder/base.js.map +1 -1
  184. package/build/user-event/event-builder/scroll-view.d.ts +1 -1
  185. package/build/user-event/event-builder/scroll-view.js.map +1 -1
  186. package/build/user-event/event-builder/text-input.d.ts +2 -2
  187. package/build/user-event/event-builder/text-input.js.map +1 -1
  188. package/build/user-event/index.d.ts +4 -4
  189. package/build/user-event/index.js.map +1 -1
  190. package/build/user-event/paste.d.ts +2 -2
  191. package/build/user-event/paste.js +8 -8
  192. package/build/user-event/paste.js.map +1 -1
  193. package/build/user-event/press/index.d.ts +1 -1
  194. package/build/user-event/press/index.js.map +1 -1
  195. package/build/user-event/press/press.d.ts +2 -2
  196. package/build/user-event/press/press.js +48 -49
  197. package/build/user-event/press/press.js.map +1 -1
  198. package/build/user-event/scroll/index.d.ts +1 -1
  199. package/build/user-event/scroll/index.js.map +1 -1
  200. package/build/user-event/scroll/scroll-to.d.ts +3 -3
  201. package/build/user-event/scroll/scroll-to.js +8 -8
  202. package/build/user-event/scroll/scroll-to.js.map +1 -1
  203. package/build/user-event/scroll/utils.d.ts +1 -1
  204. package/build/user-event/scroll/utils.js.map +1 -1
  205. package/build/user-event/setup/setup.d.ts +4 -4
  206. package/build/user-event/setup/setup.js.map +1 -1
  207. package/build/user-event/type/type.d.ts +3 -2
  208. package/build/user-event/type/type.js +16 -14
  209. package/build/user-event/type/type.js.map +1 -1
  210. package/build/user-event/utils/content-size.d.ts +1 -1
  211. package/build/user-event/utils/content-size.js.map +1 -1
  212. package/build/user-event/utils/dispatch-event.d.ts +2 -2
  213. package/build/user-event/utils/dispatch-event.js +5 -15
  214. package/build/user-event/utils/dispatch-event.js.map +1 -1
  215. package/build/user-event/utils/wait.d.ts +6 -2
  216. package/build/user-event/utils/wait.js +1 -1
  217. package/build/user-event/utils/wait.js.map +1 -1
  218. package/build/wait-for-element-to-be-removed.js +1 -1
  219. package/build/wait-for-element-to-be-removed.js.map +1 -1
  220. package/build/wait-for.js +4 -5
  221. package/build/wait-for.js.map +1 -1
  222. package/build/within.d.ts +20 -20
  223. package/build/within.js +8 -8
  224. package/build/within.js.map +1 -1
  225. package/package.json +38 -32
  226. package/typings/index.flow.js +33 -36
  227. package/build/helpers/format-default.js.map +0 -1
  228. package/build/helpers/format.d.ts +0 -7
  229. package/build/helpers/format.js +0 -31
  230. package/build/helpers/format.js.map +0 -1
  231. package/build/test-utils/index.d.ts +0 -1
  232. package/build/test-utils/index.js +0 -17
  233. package/build/test-utils/index.js.map +0 -1
package/build/within.d.ts CHANGED
@@ -1,29 +1,11 @@
1
- import { HostElement } from 'universal-test-renderer';
2
- export declare function within(instance: HostElement): {
3
- getByText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
4
- getAllByText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
5
- queryByText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
6
- queryAllByText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
7
- findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
8
- findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
9
- getByTestId: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
10
- getAllByTestId: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
11
- queryByTestId: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
12
- queryAllByTestId: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
13
- findByTestId: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
14
- findAllByTestId: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
1
+ import type { HostElement } from 'universal-test-renderer';
2
+ export declare function within(element: HostElement): {
15
3
  getByRole: import("./queries/make-queries").GetByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
16
4
  getAllByRole: import("./queries/make-queries").GetAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
17
5
  queryByRole: import("./queries/make-queries").QueryByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
18
6
  queryAllByRole: import("./queries/make-queries").QueryAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
19
7
  findByRole: import("./queries/make-queries").FindByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
20
8
  findAllByRole: import("./queries/make-queries").FindAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
21
- getByLabelText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
22
- getAllByLabelText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
23
- queryByLabelText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
24
- queryAllByLabelText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
25
- findByLabelText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
26
- findAllByLabelText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
27
9
  getByHintText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
28
10
  getAllByHintText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
29
11
  queryByHintText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
@@ -42,6 +24,12 @@ export declare function within(instance: HostElement): {
42
24
  queryAllByAccessibilityHint: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
43
25
  findByAccessibilityHint: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
44
26
  findAllByAccessibilityHint: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
27
+ getByLabelText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
28
+ getAllByLabelText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
29
+ queryByLabelText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
30
+ queryAllByLabelText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
31
+ findByLabelText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
32
+ findAllByLabelText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
45
33
  getByPlaceholderText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
46
34
  getAllByPlaceholderText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
47
35
  queryByPlaceholderText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
@@ -54,5 +42,17 @@ export declare function within(instance: HostElement): {
54
42
  queryAllByDisplayValue: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
55
43
  findByDisplayValue: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
56
44
  findAllByDisplayValue: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
45
+ getByTestId: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
46
+ getAllByTestId: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
47
+ queryByTestId: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
48
+ queryAllByTestId: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
49
+ findByTestId: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
50
+ findAllByTestId: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
51
+ getByText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
52
+ getAllByText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
53
+ queryByText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
54
+ queryAllByText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
55
+ findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
56
+ findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
57
57
  };
58
58
  export declare const getQueriesForElement: typeof within;
package/build/within.js CHANGED
@@ -12,15 +12,15 @@ var _placeholderText = require("./queries/placeholder-text");
12
12
  var _role = require("./queries/role");
13
13
  var _testId = require("./queries/test-id");
14
14
  var _text = require("./queries/text");
15
- function within(instance) {
15
+ function within(element) {
16
16
  return {
17
- ...(0, _displayValue.bindByDisplayValueQueries)(instance),
18
- ...(0, _placeholderText.bindByPlaceholderTextQueries)(instance),
19
- ...(0, _hintText.bindByHintTextQueries)(instance),
20
- ...(0, _labelText.bindByLabelTextQueries)(instance),
21
- ...(0, _role.bindByRoleQueries)(instance),
22
- ...(0, _testId.bindByTestIdQueries)(instance),
23
- ...(0, _text.bindByTextQueries)(instance)
17
+ ...(0, _text.bindByTextQueries)(element),
18
+ ...(0, _testId.bindByTestIdQueries)(element),
19
+ ...(0, _displayValue.bindByDisplayValueQueries)(element),
20
+ ...(0, _placeholderText.bindByPlaceholderTextQueries)(element),
21
+ ...(0, _labelText.bindByLabelTextQueries)(element),
22
+ ...(0, _hintText.bindByHintTextQueries)(element),
23
+ ...(0, _role.bindByRoleQueries)(element)
24
24
  };
25
25
  }
26
26
  const getQueriesForElement = exports.getQueriesForElement = within;
@@ -1 +1 @@
1
- {"version":3,"file":"within.js","names":["_displayValue","require","_hintText","_labelText","_placeholderText","_role","_testId","_text","within","instance","bindByDisplayValueQueries","bindByPlaceholderTextQueries","bindByHintTextQueries","bindByLabelTextQueries","bindByRoleQueries","bindByTestIdQueries","bindByTextQueries","getQueriesForElement","exports"],"sources":["../src/within.ts"],"sourcesContent":["import { HostElement } from 'universal-test-renderer';\nimport { bindByDisplayValueQueries } from './queries/display-value';\nimport { bindByHintTextQueries } from './queries/hint-text';\nimport { bindByLabelTextQueries } from './queries/label-text';\nimport { bindByPlaceholderTextQueries } from './queries/placeholder-text';\nimport { bindByRoleQueries } from './queries/role';\nimport { bindByTestIdQueries } from './queries/test-id';\nimport { bindByTextQueries } from './queries/text';\n\nexport function within(instance: HostElement) {\n return {\n ...bindByDisplayValueQueries(instance),\n ...bindByPlaceholderTextQueries(instance),\n ...bindByHintTextQueries(instance),\n ...bindByLabelTextQueries(instance),\n ...bindByRoleQueries(instance),\n ...bindByTestIdQueries(instance),\n ...bindByTextQueries(instance),\n };\n}\n\nexport const getQueriesForElement = within;\n"],"mappings":";;;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEO,SAASO,MAAMA,CAACC,QAAqB,EAAE;EAC5C,OAAO;IACL,GAAG,IAAAC,uCAAyB,EAACD,QAAQ,CAAC;IACtC,GAAG,IAAAE,6CAA4B,EAACF,QAAQ,CAAC;IACzC,GAAG,IAAAG,+BAAqB,EAACH,QAAQ,CAAC;IAClC,GAAG,IAAAI,iCAAsB,EAACJ,QAAQ,CAAC;IACnC,GAAG,IAAAK,uBAAiB,EAACL,QAAQ,CAAC;IAC9B,GAAG,IAAAM,2BAAmB,EAACN,QAAQ,CAAC;IAChC,GAAG,IAAAO,uBAAiB,EAACP,QAAQ;EAC/B,CAAC;AACH;AAEO,MAAMQ,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAGT,MAAM","ignoreList":[]}
1
+ {"version":3,"file":"within.js","names":["_displayValue","require","_hintText","_labelText","_placeholderText","_role","_testId","_text","within","element","bindByTextQueries","bindByTestIdQueries","bindByDisplayValueQueries","bindByPlaceholderTextQueries","bindByLabelTextQueries","bindByHintTextQueries","bindByRoleQueries","getQueriesForElement","exports"],"sources":["../src/within.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport { bindByDisplayValueQueries } from './queries/display-value';\nimport { bindByHintTextQueries } from './queries/hint-text';\nimport { bindByLabelTextQueries } from './queries/label-text';\nimport { bindByPlaceholderTextQueries } from './queries/placeholder-text';\nimport { bindByRoleQueries } from './queries/role';\nimport { bindByTestIdQueries } from './queries/test-id';\nimport { bindByTextQueries } from './queries/text';\n\nexport function within(element: HostElement) {\n return {\n ...bindByTextQueries(element),\n ...bindByTestIdQueries(element),\n ...bindByDisplayValueQueries(element),\n ...bindByPlaceholderTextQueries(element),\n ...bindByLabelTextQueries(element),\n ...bindByHintTextQueries(element),\n ...bindByRoleQueries(element),\n };\n}\n\nexport const getQueriesForElement = within;\n"],"mappings":";;;;;;;AAEA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEO,SAASO,MAAMA,CAACC,OAAoB,EAAE;EAC3C,OAAO;IACL,GAAG,IAAAC,uBAAiB,EAACD,OAAO,CAAC;IAC7B,GAAG,IAAAE,2BAAmB,EAACF,OAAO,CAAC;IAC/B,GAAG,IAAAG,uCAAyB,EAACH,OAAO,CAAC;IACrC,GAAG,IAAAI,6CAA4B,EAACJ,OAAO,CAAC;IACxC,GAAG,IAAAK,iCAAsB,EAACL,OAAO,CAAC;IAClC,GAAG,IAAAM,+BAAqB,EAACN,OAAO,CAAC;IACjC,GAAG,IAAAO,uBAAiB,EAACP,OAAO;EAC9B,CAAC;AACH;AAEO,MAAMQ,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAGT,MAAM","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testing-library/react-native",
3
- "version": "14.0.0-alpha.0",
3
+ "version": "14.0.0-alpha.2",
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",
@@ -30,12 +30,15 @@
30
30
  "typecheck": "tsc",
31
31
  "copy-flowtypes": "cp typings/index.flow.js build",
32
32
  "lint": "eslint src --cache",
33
- "validate": "yarn lint && yarn typecheck && yarn test",
33
+ "validate": "yarn prettier && yarn lint && yarn typecheck && yarn test",
34
34
  "build:js": "babel src --out-dir build --extensions \".js,.ts,.jsx,.tsx\" --source-maps --ignore \"**/__tests__/**\"",
35
35
  "build:ts": "tsc --build tsconfig.release.json",
36
36
  "build": "yarn clean && yarn build:js && yarn build:ts && yarn copy-flowtypes",
37
37
  "release": "release-it",
38
- "release:alpha": "release-it --preRelease=alpha"
38
+ "release:rc": "release-it --preRelease=rc",
39
+ "release:alpha": "release-it --preRelease=alpha",
40
+ "prettier": "prettier --check .",
41
+ "prettier:write": "prettier --write ."
39
42
  },
40
43
  "files": [
41
44
  "build/",
@@ -47,15 +50,16 @@
47
50
  "typings/index.flow.js"
48
51
  ],
49
52
  "dependencies": {
50
- "jest-matcher-utils": "^29.7.0",
51
- "pretty-format": "^29.7.0",
53
+ "jest-matcher-utils": "^30.2.0",
54
+ "picocolors": "^1.1.1",
55
+ "pretty-format": "^30.2.0",
52
56
  "redent": "^3.0.0"
53
57
  },
54
58
  "peerDependencies": {
55
59
  "jest": ">=29.0.0",
56
60
  "react": ">=19.0.0",
57
- "react-native": ">=0.77",
58
- "universal-test-renderer": "0.5.0"
61
+ "react-native": ">=0.71",
62
+ "universal-test-renderer": "~0.10.0"
59
63
  },
60
64
  "peerDependenciesMeta": {
61
65
  "jest": {
@@ -63,39 +67,41 @@
63
67
  }
64
68
  },
65
69
  "devDependencies": {
66
- "@babel/cli": "^7.25.9",
67
- "@babel/core": "^7.26.0",
68
- "@babel/plugin-transform-strict-mode": "^7.25.9",
69
- "@babel/preset-env": "^7.26.0",
70
- "@babel/preset-flow": "^7.25.9",
71
- "@babel/preset-react": "^7.25.9",
72
- "@babel/preset-typescript": "^7.26.0",
70
+ "@babel/cli": "^7.28.3",
71
+ "@babel/core": "^7.28.5",
72
+ "@babel/plugin-transform-strict-mode": "^7.27.1",
73
+ "@babel/preset-env": "^7.28.5",
74
+ "@babel/preset-flow": "^7.27.1",
75
+ "@babel/preset-react": "^7.28.5",
76
+ "@babel/preset-typescript": "^7.28.5",
73
77
  "@callstack/eslint-config": "^15.0.0",
74
- "@react-native/babel-preset": "0.77.0-nightly-20241107-0ca2ba082",
75
- "@release-it/conventional-changelog": "^9.0.2",
78
+ "@react-native/babel-preset": "0.82.1",
79
+ "@release-it/conventional-changelog": "^10.0.2",
76
80
  "@relmify/jest-serializer-strip-ansi": "^1.0.2",
77
- "@types/jest": "^29.5.14",
78
- "@types/react": "^18.3.12",
79
- "babel-jest": "^29.7.0",
81
+ "@types/jest": "^30.0.0",
82
+ "@types/node": "^24.10.1",
83
+ "@types/react": "^19.2.6",
84
+ "babel-jest": "^30.2.0",
80
85
  "babel-plugin-module-resolver": "^5.0.2",
81
- "del-cli": "^6.0.0",
82
- "eslint": "^8.57.1",
83
- "eslint-plugin-prettier": "^4.2.1",
86
+ "del-cli": "^7.0.0",
87
+ "eslint": "^9.39.1",
88
+ "eslint-plugin-simple-import-sort": "^12.1.1",
84
89
  "flow-bin": "~0.170.0",
85
- "jest": "^29.7.0",
86
- "prettier": "^2.8.8",
87
- "react": "19.0.0-rc-fb9a90fa48-20240614",
88
- "react-native": "0.77.0-nightly-20241107-0ca2ba082",
89
- "release-it": "^17.10.0",
90
- "strip-ansi": "^6.0.1",
91
- "typescript": "^5.6.3",
92
- "universal-test-renderer": "0.5.0"
90
+ "jest": "^30.2.0",
91
+ "prettier": "^3.6.2",
92
+ "react": "19.1.1",
93
+ "react-native": "0.82.1",
94
+ "react-native-gesture-handler": "^2.29.1",
95
+ "release-it": "^19.0.6",
96
+ "typescript": "^5.9.3",
97
+ "typescript-eslint": "^8.47.0",
98
+ "universal-test-renderer": "0.10.0"
93
99
  },
94
100
  "publishConfig": {
95
101
  "registry": "https://registry.npmjs.org"
96
102
  },
97
- "packageManager": "yarn@4.4.0",
103
+ "packageManager": "yarn@4.11.0",
98
104
  "engines": {
99
- "node": ">=20"
105
+ "node": ">=18"
100
106
  }
101
107
  }
@@ -55,10 +55,10 @@ declare type A11yRole =
55
55
 
56
56
  declare type A11yState = {|
57
57
  disabled?: boolean,
58
- selected ?: boolean,
59
- checked ?: boolean | 'mixed',
60
- busy ?: boolean,
61
- expanded ?: boolean,
58
+ selected?: boolean,
59
+ checked?: boolean | 'mixed',
60
+ busy?: boolean,
61
+ expanded?: boolean,
62
62
  |};
63
63
 
64
64
  declare type A11yValue = {
@@ -86,12 +86,12 @@ interface ByTextQueries {
86
86
  findByText: (
87
87
  text: TextMatch,
88
88
  queryOptions?: ByTextOptions,
89
- waitForOptions?: WaitForOptions
89
+ waitForOptions?: WaitForOptions,
90
90
  ) => FindReturn;
91
91
  findAllByText: (
92
92
  text: TextMatch,
93
93
  queryOptions?: ByTextOptions,
94
- waitForOptions?: WaitForOptions
94
+ waitForOptions?: WaitForOptions,
95
95
  ) => FindAllReturn;
96
96
  }
97
97
 
@@ -105,12 +105,12 @@ interface ByTestIdQueries {
105
105
  findByTestId: (
106
106
  testID: TextMatch,
107
107
  queryOptions?: ByTestIdOptions,
108
- waitForOptions?: WaitForOptions
108
+ waitForOptions?: WaitForOptions,
109
109
  ) => FindReturn;
110
110
  findAllByTestId: (
111
111
  testID: TextMatch,
112
112
  queryOptions?: ByTestIdOptions,
113
- waitForOptions?: WaitForOptions
113
+ waitForOptions?: WaitForOptions,
114
114
  ) => FindAllReturn;
115
115
  }
116
116
 
@@ -120,25 +120,25 @@ interface ByDisplayValueQueries {
120
120
  getByDisplayValue: (value: TextMatch, options?: ByDisplayValueOptions) => ReactTestInstance;
121
121
  getAllByDisplayValue: (
122
122
  value: TextMatch,
123
- options?: ByDisplayValueOptions
123
+ options?: ByDisplayValueOptions,
124
124
  ) => Array<ReactTestInstance>;
125
125
  queryByDisplayValue: (
126
126
  value: TextMatch,
127
- options?: ByDisplayValueOptions
127
+ options?: ByDisplayValueOptions,
128
128
  ) => ReactTestInstance | null;
129
129
  queryAllByDisplayValue: (
130
130
  value: TextMatch,
131
- options?: ByDisplayValueOptions
131
+ options?: ByDisplayValueOptions,
132
132
  ) => Array<ReactTestInstance> | [];
133
133
  findByDisplayValue: (
134
134
  value: TextMatch,
135
135
  queryOptions?: ByDisplayValueOptions,
136
- waitForOptions?: WaitForOptions
136
+ waitForOptions?: WaitForOptions,
137
137
  ) => FindReturn;
138
138
  findAllByDisplayValue: (
139
139
  value: TextMatch,
140
140
  queryOptions?: ByDisplayValueOptions,
141
- waitForOptions?: WaitForOptions
141
+ waitForOptions?: WaitForOptions,
142
142
  ) => FindAllReturn;
143
143
  }
144
144
 
@@ -147,29 +147,29 @@ type ByPlaceholderTextOptions = CommonQueryOptions & TextMatchOptions;
147
147
  interface ByPlaceholderTextQueries {
148
148
  getByPlaceholderText: (
149
149
  placeholder: TextMatch,
150
- options?: ByPlaceholderTextOptions
150
+ options?: ByPlaceholderTextOptions,
151
151
  ) => ReactTestInstance;
152
152
  getAllByPlaceholderText: (
153
153
  placeholder: TextMatch,
154
- options?: ByPlaceholderTextOptions
154
+ options?: ByPlaceholderTextOptions,
155
155
  ) => Array<ReactTestInstance>;
156
156
  queryByPlaceholderText: (
157
157
  placeholder: TextMatch,
158
- options?: ByPlaceholderTextOptions
158
+ options?: ByPlaceholderTextOptions,
159
159
  ) => ReactTestInstance | null;
160
160
  queryAllByPlaceholderText: (
161
161
  placeholder: TextMatch,
162
- options?: ByPlaceholderTextOptions
162
+ options?: ByPlaceholderTextOptions,
163
163
  ) => Array<ReactTestInstance> | [];
164
164
  findByPlaceholderText: (
165
165
  placeholder: TextMatch,
166
166
  queryOptions?: ByPlaceholderTextOptions,
167
- waitForOptions?: WaitForOptions
167
+ waitForOptions?: WaitForOptions,
168
168
  ) => FindReturn;
169
169
  findAllByPlaceholderText: (
170
170
  placeholder: TextMatch,
171
171
  queryOptions?: ByPlaceholderTextOptions,
172
- waitForOptions?: WaitForOptions
172
+ waitForOptions?: WaitForOptions,
173
173
  ) => FindAllReturn;
174
174
  }
175
175
 
@@ -205,12 +205,12 @@ interface A11yAPI {
205
205
  findByLabelText: (
206
206
  matcher: TextMatch,
207
207
  queryOptions?: ByLabelTextOptions,
208
- waitForOptions?: WaitForOptions
208
+ waitForOptions?: WaitForOptions,
209
209
  ) => FindReturn;
210
210
  findAllByLabelText: (
211
211
  matcher: TextMatch,
212
212
  queryOptions?: ByLabelTextOptions,
213
- waitForOptions?: WaitForOptions
213
+ waitForOptions?: WaitForOptions,
214
214
  ) => FindAllReturn;
215
215
 
216
216
  // Hint
@@ -225,22 +225,22 @@ interface A11yAPI {
225
225
  findByA11yHint: (
226
226
  matcher: TextMatch,
227
227
  queryOptions?: ByHintTextOptions,
228
- waitForOptions?: WaitForOptions
228
+ waitForOptions?: WaitForOptions,
229
229
  ) => FindReturn;
230
230
  findByHintText: (
231
231
  matcher: TextMatch,
232
232
  queryOptions?: ByHintTextOptions,
233
- waitForOptions?: WaitForOptions
233
+ waitForOptions?: WaitForOptions,
234
234
  ) => FindReturn;
235
235
  findAllByA11yHint: (
236
236
  matcher: TextMatch,
237
237
  queryOptions?: ByHintTextOptions,
238
- waitForOptions?: WaitForOptions
238
+ waitForOptions?: WaitForOptions,
239
239
  ) => FindAllReturn;
240
240
  findAllByHintText: (
241
241
  matcher: TextMatch,
242
242
  queryOptions?: ByHintTextOptions,
243
- waitForOptions?: WaitForOptions
243
+ waitForOptions?: WaitForOptions,
244
244
  ) => FindAllReturn;
245
245
 
246
246
  // Role
@@ -251,12 +251,12 @@ interface A11yAPI {
251
251
  findByRole: (
252
252
  matcher: A11yRole | RegExp,
253
253
  queryOptions?: ByRoleOptions,
254
- waitForOptions?: WaitForOptions
254
+ waitForOptions?: WaitForOptions,
255
255
  ) => FindReturn;
256
256
  findAllByRole: (
257
257
  matcher: A11yRole | RegExp,
258
258
  queryOptions?: ByRoleOptions,
259
- waitForOptions?: WaitForOptions
259
+ waitForOptions?: WaitForOptions,
260
260
  ) => FindAllReturn;
261
261
  }
262
262
 
@@ -266,7 +266,7 @@ interface Thenable {
266
266
 
267
267
  type MapPropsFunction = (
268
268
  props: { [string]: mixed },
269
- node: ReactTestRendererJSON
269
+ node: ReactTestRendererJSON,
270
270
  ) => { [string]: mixed };
271
271
 
272
272
  type DebugOptions = {
@@ -274,10 +274,6 @@ type DebugOptions = {
274
274
  mapProps?: MapPropsFunction,
275
275
  };
276
276
 
277
- type Debug = {
278
- (options?: DebugOptions | string): void,
279
- };
280
-
281
277
  type Queries = ByTextQueries &
282
278
  ByTestIdQueries &
283
279
  ByDisplayValueQueries &
@@ -304,7 +300,7 @@ declare module '@testing-library/react-native' {
304
300
  rerender(nextElement: React.Element<any>): void;
305
301
  unmount(nextElement?: React.Element<any>): void;
306
302
  toJSON(): ReactTestRendererJSON[] | ReactTestRendererJSON | null;
307
- debug: Debug;
303
+ debug(options?: DebugOptions): void;
308
304
  root: ReactTestInstance;
309
305
  UNSAFE_root: ReactTestInstance;
310
306
  }
@@ -314,6 +310,7 @@ declare module '@testing-library/react-native' {
314
310
  declare interface RenderOptions {
315
311
  wrapper?: React.ComponentType<any>;
316
312
  createNodeMock?: (element: React.Element<any>) => any;
313
+ unstable_validateStringsRenderedWithinText?: boolean;
317
314
  unstable_isConcurrent?: boolean;
318
315
  unstable_strictMode?: boolean;
319
316
  unstable_concurrentUpdatesByDefault?: boolean;
@@ -321,7 +318,7 @@ declare module '@testing-library/react-native' {
321
318
 
322
319
  declare export var render: (
323
320
  component: React.Element<any>,
324
- options?: RenderOptions
321
+ options?: RenderOptions,
325
322
  ) => RenderResult;
326
323
 
327
324
  declare export var screen: RenderResult;
@@ -333,7 +330,7 @@ declare module '@testing-library/react-native' {
333
330
 
334
331
  declare type WaitForElementToBeRemovedFunction = <T = any>(
335
332
  expectation: () => T,
336
- options?: WaitForOptions
333
+ options?: WaitForOptions,
337
334
  ) => Promise<T>;
338
335
 
339
336
  declare export var waitForElementToBeRemoved: WaitForElementToBeRemovedFunction;
@@ -374,7 +371,7 @@ declare module '@testing-library/react-native' {
374
371
 
375
372
  declare type RenderHookFunction = <Result, Props>(
376
373
  renderCallback: (props: Props) => Result,
377
- options?: RenderHookOptions<Props>
374
+ options?: RenderHookOptions<Props>,
378
375
  ) => RenderHookResult<Result, Props>;
379
376
 
380
377
  declare export var renderHook: RenderHookFunction;
@@ -1 +0,0 @@
1
- {"version":3,"file":"format-default.js","names":["_reactNative","require","_object","propsToDisplay","defaultMapProps","props","result","styles","StyleSheet","flatten","style","styleToDisplay","extractStyle","undefined","accessibilityState","removeUndefinedKeys","accessibilityValue","forEach","propName","display","opacity","hasAnyKeys","Object","keys","length"],"sources":["../../src/helpers/format-default.ts"],"sourcesContent":["import { StyleSheet, ViewStyle } from 'react-native';\nimport { removeUndefinedKeys } from './object';\n\nconst propsToDisplay = [\n 'accessible',\n 'accessibilityElementsHidden',\n 'accessibilityHint',\n 'accessibilityLabel',\n 'accessibilityLabelledBy',\n 'accessibilityRole',\n 'accessibilityViewIsModal',\n 'alt',\n 'aria-busy',\n 'aria-checked',\n 'aria-disabled',\n 'aria-expanded',\n 'aria-hidden',\n 'aria-label',\n 'aria-labelledby',\n 'aria-modal',\n 'aria-selected',\n 'aria-valuemax',\n 'aria-valuemin',\n 'aria-valuenow',\n 'aria-valuetext',\n 'defaultValue',\n 'importantForAccessibility',\n 'nativeID',\n 'placeholder',\n 'role',\n 'testID',\n 'title',\n 'value',\n] as const;\n\n/**\n * Preserve props that are helpful in diagnosing test failures, while stripping rest\n */\nexport function defaultMapProps(props: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n const styles = StyleSheet.flatten(props.style as ViewStyle);\n const styleToDisplay = extractStyle(styles);\n if (styleToDisplay !== undefined) {\n result.style = styleToDisplay;\n }\n\n const accessibilityState = removeUndefinedKeys(props.accessibilityState);\n if (accessibilityState !== undefined) {\n result.accessibilityState = accessibilityState;\n }\n\n const accessibilityValue = removeUndefinedKeys(props.accessibilityValue);\n if (accessibilityValue !== undefined) {\n result.accessibilityValue = accessibilityValue;\n }\n\n propsToDisplay.forEach((propName) => {\n if (propName in props) {\n result[propName] = props[propName];\n }\n });\n\n return result;\n}\n\nfunction extractStyle(style: ViewStyle | undefined) {\n if (style == null) {\n return undefined;\n }\n\n const result: Record<string, unknown> = {};\n if (style.display === 'none') {\n result.display = 'none';\n }\n\n if (style.opacity === 0) {\n result.opacity = 0;\n }\n\n const hasAnyKeys = Object.keys(result).length > 0;\n return hasAnyKeys ? result : undefined;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,MAAME,cAAc,GAAG,CACrB,YAAY,EACZ,6BAA6B,EAC7B,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EACnB,0BAA0B,EAC1B,KAAK,EACL,WAAW,EACX,cAAc,EACd,eAAe,EACf,eAAe,EACf,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,2BAA2B,EAC3B,UAAU,EACV,aAAa,EACb,MAAM,EACN,QAAQ,EACR,OAAO,EACP,OAAO,CACC;;AAEV;AACA;AACA;AACO,SAASC,eAAeA,CAACC,KAA8B,EAA2B;EACvF,MAAMC,MAA+B,GAAG,CAAC,CAAC;EAE1C,MAAMC,MAAM,GAAGC,uBAAU,CAACC,OAAO,CAACJ,KAAK,CAACK,KAAkB,CAAC;EAC3D,MAAMC,cAAc,GAAGC,YAAY,CAACL,MAAM,CAAC;EAC3C,IAAII,cAAc,KAAKE,SAAS,EAAE;IAChCP,MAAM,CAACI,KAAK,GAAGC,cAAc;EAC/B;EAEA,MAAMG,kBAAkB,GAAG,IAAAC,2BAAmB,EAACV,KAAK,CAACS,kBAAkB,CAAC;EACxE,IAAIA,kBAAkB,KAAKD,SAAS,EAAE;IACpCP,MAAM,CAACQ,kBAAkB,GAAGA,kBAAkB;EAChD;EAEA,MAAME,kBAAkB,GAAG,IAAAD,2BAAmB,EAACV,KAAK,CAACW,kBAAkB,CAAC;EACxE,IAAIA,kBAAkB,KAAKH,SAAS,EAAE;IACpCP,MAAM,CAACU,kBAAkB,GAAGA,kBAAkB;EAChD;EAEAb,cAAc,CAACc,OAAO,CAAEC,QAAQ,IAAK;IACnC,IAAIA,QAAQ,IAAIb,KAAK,EAAE;MACrBC,MAAM,CAACY,QAAQ,CAAC,GAAGb,KAAK,CAACa,QAAQ,CAAC;IACpC;EACF,CAAC,CAAC;EAEF,OAAOZ,MAAM;AACf;AAEA,SAASM,YAAYA,CAACF,KAA4B,EAAE;EAClD,IAAIA,KAAK,IAAI,IAAI,EAAE;IACjB,OAAOG,SAAS;EAClB;EAEA,MAAMP,MAA+B,GAAG,CAAC,CAAC;EAC1C,IAAII,KAAK,CAACS,OAAO,KAAK,MAAM,EAAE;IAC5Bb,MAAM,CAACa,OAAO,GAAG,MAAM;EACzB;EAEA,IAAIT,KAAK,CAACU,OAAO,KAAK,CAAC,EAAE;IACvBd,MAAM,CAACc,OAAO,GAAG,CAAC;EACpB;EAEA,MAAMC,UAAU,GAAGC,MAAM,CAACC,IAAI,CAACjB,MAAM,CAAC,CAACkB,MAAM,GAAG,CAAC;EACjD,OAAOH,UAAU,GAAGf,MAAM,GAAGO,SAAS;AACxC","ignoreList":[]}
@@ -1,7 +0,0 @@
1
- import { JsonElement, JsonNode } from 'universal-test-renderer';
2
- export type MapPropsFunction = (props: Record<string, unknown>, node: JsonElement) => Record<string, unknown>;
3
- export type FormatOptions = {
4
- mapProps?: MapPropsFunction;
5
- };
6
- declare const format: (input: JsonNode | JsonNode[], options?: FormatOptions) => string;
7
- export default format;
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _prettyFormat = _interopRequireWildcard(require("pretty-format"));
8
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
- const format = (input, options = {}) => (0, _prettyFormat.default)(input, {
11
- plugins: [getCustomPlugin(options.mapProps), _prettyFormat.plugins.ReactElement],
12
- highlight: true,
13
- printBasicPrototype: false
14
- });
15
- const getCustomPlugin = mapProps => {
16
- return {
17
- test: val => _prettyFormat.plugins.ReactTestComponent.test(val),
18
- serialize: (val, config, indentation, depth, refs, printer) => {
19
- let newVal = val;
20
- if (mapProps && val.props) {
21
- newVal = {
22
- ...val,
23
- props: mapProps(val.props, val)
24
- };
25
- }
26
- return _prettyFormat.plugins.ReactTestComponent.serialize(newVal, config, indentation, depth, refs, printer);
27
- }
28
- };
29
- };
30
- var _default = exports.default = format;
31
- //# sourceMappingURL=format.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format.js","names":["_prettyFormat","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","format","input","options","prettyFormat","plugins","getCustomPlugin","mapProps","ReactElement","highlight","printBasicPrototype","test","val","ReactTestComponent","serialize","config","indentation","depth","refs","printer","newVal","props","_default","exports"],"sources":["../../src/helpers/format.ts"],"sourcesContent":["import prettyFormat, { NewPlugin, plugins } from 'pretty-format';\nimport { JsonElement, JsonNode } from 'universal-test-renderer';\n\nexport type MapPropsFunction = (\n props: Record<string, unknown>,\n node: JsonElement,\n) => Record<string, unknown>;\n\nexport type FormatOptions = {\n mapProps?: MapPropsFunction;\n};\n\nconst format = (input: JsonNode | JsonNode[], options: FormatOptions = {}) =>\n prettyFormat(input, {\n plugins: [getCustomPlugin(options.mapProps), plugins.ReactElement],\n highlight: true,\n printBasicPrototype: false,\n });\n\nconst getCustomPlugin = (mapProps?: MapPropsFunction): NewPlugin => {\n return {\n test: (val) => plugins.ReactTestComponent.test(val),\n serialize: (val, config, indentation, depth, refs, printer) => {\n let newVal = val;\n if (mapProps && val.props) {\n newVal = { ...val, props: mapProps(val.props, val) };\n }\n return plugins.ReactTestComponent.serialize(\n newVal,\n config,\n indentation,\n depth,\n refs,\n printer,\n );\n },\n };\n};\n\nexport default format;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAiE,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAYjE,MAAMW,MAAM,GAAGA,CAACC,KAA4B,EAAEC,OAAsB,GAAG,CAAC,CAAC,KACvE,IAAAC,qBAAY,EAACF,KAAK,EAAE;EAClBG,OAAO,EAAE,CAACC,eAAe,CAACH,OAAO,CAACI,QAAQ,CAAC,EAAEF,qBAAO,CAACG,YAAY,CAAC;EAClEC,SAAS,EAAE,IAAI;EACfC,mBAAmB,EAAE;AACvB,CAAC,CAAC;AAEJ,MAAMJ,eAAe,GAAIC,QAA2B,IAAgB;EAClE,OAAO;IACLI,IAAI,EAAGC,GAAG,IAAKP,qBAAO,CAACQ,kBAAkB,CAACF,IAAI,CAACC,GAAG,CAAC;IACnDE,SAAS,EAAEA,CAACF,GAAG,EAAEG,MAAM,EAAEC,WAAW,EAAEC,KAAK,EAAEC,IAAI,EAAEC,OAAO,KAAK;MAC7D,IAAIC,MAAM,GAAGR,GAAG;MAChB,IAAIL,QAAQ,IAAIK,GAAG,CAACS,KAAK,EAAE;QACzBD,MAAM,GAAG;UAAE,GAAGR,GAAG;UAAES,KAAK,EAAEd,QAAQ,CAACK,GAAG,CAACS,KAAK,EAAET,GAAG;QAAE,CAAC;MACtD;MACA,OAAOP,qBAAO,CAACQ,kBAAkB,CAACC,SAAS,CACzCM,MAAM,EACNL,MAAM,EACNC,WAAW,EACXC,KAAK,EACLC,IAAI,EACJC,OACF,CAAC;IACH;EACF,CAAC;AACH,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAApC,OAAA,GAEac,MAAM","ignoreList":[]}
@@ -1 +0,0 @@
1
- export * from './events';
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _events = require("./events");
7
- Object.keys(_events).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _events[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _events[key];
14
- }
15
- });
16
- });
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["_events","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../src/test-utils/index.ts"],"sourcesContent":["export * from './events';\n"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}