@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/render.d.ts CHANGED
@@ -1,51 +1,36 @@
1
1
  import * as React from 'react';
2
- import { HostElement } from 'universal-test-renderer/react-native';
3
- import { DebugOptions } from './helpers/debug';
2
+ import type { HostElement } from 'universal-test-renderer';
3
+ import type { DebugOptions } from './helpers/debug';
4
4
  export interface RenderOptions {
5
5
  /**
6
6
  * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating
7
- * reusable custom render functions for common data providers.
7
+ * reusable custom render functions for common data providers.
8
8
  */
9
9
  wrapper?: React.ComponentType<any>;
10
- createNodeMock?: (element: React.ReactElement) => object;
10
+ createNodeMock?: (element: React.ReactElement) => unknown;
11
11
  }
12
12
  export type RenderResult = ReturnType<typeof render>;
13
13
  /**
14
14
  * Renders test component deeply using React Test Renderer and exposes helpers
15
15
  * to assert on the output.
16
16
  */
17
- export default function render<T>(element: React.ReactElement<T>, options?: RenderOptions): {
18
- update: (element: React.ReactElement) => void;
17
+ export default function render<T>(component: React.ReactElement<T>, options?: RenderOptions): {
18
+ rerender: (component: React.ReactElement) => void;
19
+ rerenderAsync: (component: React.ReactElement) => Promise<void>;
20
+ update: (component: React.ReactElement) => void;
21
+ updateAsync: (component: React.ReactElement) => Promise<void>;
19
22
  unmount: () => void;
20
- rerender: (element: React.ReactElement) => void;
21
- toJSON: () => import("universal-test-renderer").JsonNode | null | undefined;
23
+ unmountAsync: () => Promise<void>;
24
+ toJSON: () => import("universal-test-renderer").JsonNode | null;
22
25
  debug: DebugFunction;
23
26
  container: HostElement;
24
27
  root: HostElement | null;
25
- getByText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
26
- getAllByText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
27
- queryByText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
28
- queryAllByText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
29
- findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
30
- findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
31
- getByTestId: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
32
- getAllByTestId: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
33
- queryByTestId: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
34
- queryAllByTestId: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
35
- findByTestId: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
36
- findAllByTestId: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
37
28
  getByRole: import("./queries/make-queries").GetByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
38
29
  getAllByRole: import("./queries/make-queries").GetAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
39
30
  queryByRole: import("./queries/make-queries").QueryByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
40
31
  queryAllByRole: import("./queries/make-queries").QueryAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
41
32
  findByRole: import("./queries/make-queries").FindByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
42
33
  findAllByRole: import("./queries/make-queries").FindAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
43
- getByLabelText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
44
- getAllByLabelText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
45
- queryByLabelText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
46
- queryAllByLabelText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
47
- findByLabelText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
48
- findAllByLabelText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
49
34
  getByHintText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
50
35
  getAllByHintText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
51
36
  queryByHintText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
@@ -64,6 +49,12 @@ export default function render<T>(element: React.ReactElement<T>, options?: Rend
64
49
  queryAllByAccessibilityHint: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
65
50
  findByAccessibilityHint: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
66
51
  findAllByAccessibilityHint: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
52
+ getByLabelText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
53
+ getAllByLabelText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
54
+ queryByLabelText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
55
+ queryAllByLabelText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
56
+ findByLabelText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
57
+ findAllByLabelText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
67
58
  getByPlaceholderText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
68
59
  getAllByPlaceholderText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
69
60
  queryByPlaceholderText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
@@ -76,39 +67,36 @@ export default function render<T>(element: React.ReactElement<T>, options?: Rend
76
67
  queryAllByDisplayValue: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
77
68
  findByDisplayValue: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
78
69
  findAllByDisplayValue: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
79
- };
80
- export declare function renderInternal<T>(element: React.ReactElement<T>, options?: RenderOptions): {
81
- update: (element: React.ReactElement) => void;
82
- unmount: () => void;
83
- rerender: (element: React.ReactElement) => void;
84
- toJSON: () => import("universal-test-renderer").JsonNode | null | undefined;
85
- debug: DebugFunction;
86
- container: HostElement;
87
- root: HostElement | null;
88
- getByText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
89
- getAllByText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
90
- queryByText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
91
- queryAllByText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
92
- findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
93
- findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
94
70
  getByTestId: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
95
71
  getAllByTestId: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
96
72
  queryByTestId: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
97
73
  queryAllByTestId: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
98
74
  findByTestId: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
99
75
  findAllByTestId: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
76
+ getByText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
77
+ getAllByText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
78
+ queryByText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
79
+ queryAllByText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
80
+ findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
81
+ findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
82
+ };
83
+ export declare function renderInternal<T>(component: React.ReactElement<T>, options?: RenderOptions): {
84
+ rerender: (component: React.ReactElement) => void;
85
+ rerenderAsync: (component: React.ReactElement) => Promise<void>;
86
+ update: (component: React.ReactElement) => void;
87
+ updateAsync: (component: React.ReactElement) => Promise<void>;
88
+ unmount: () => void;
89
+ unmountAsync: () => Promise<void>;
90
+ toJSON: () => import("universal-test-renderer").JsonNode | null;
91
+ debug: DebugFunction;
92
+ container: HostElement;
93
+ root: HostElement | null;
100
94
  getByRole: import("./queries/make-queries").GetByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
101
95
  getAllByRole: import("./queries/make-queries").GetAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
102
96
  queryByRole: import("./queries/make-queries").QueryByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
103
97
  queryAllByRole: import("./queries/make-queries").QueryAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
104
98
  findByRole: import("./queries/make-queries").FindByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
105
99
  findAllByRole: import("./queries/make-queries").FindAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
106
- getByLabelText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
107
- getAllByLabelText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
108
- queryByLabelText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
109
- queryAllByLabelText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
110
- findByLabelText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
111
- findAllByLabelText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
112
100
  getByHintText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
113
101
  getAllByHintText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
114
102
  queryByHintText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
@@ -127,6 +115,12 @@ export declare function renderInternal<T>(element: React.ReactElement<T>, option
127
115
  queryAllByAccessibilityHint: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
128
116
  findByAccessibilityHint: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
129
117
  findAllByAccessibilityHint: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
118
+ getByLabelText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
119
+ getAllByLabelText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
120
+ queryByLabelText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
121
+ queryAllByLabelText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
122
+ findByLabelText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
123
+ findAllByLabelText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
130
124
  getByPlaceholderText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
131
125
  getAllByPlaceholderText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
132
126
  queryByPlaceholderText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
@@ -139,5 +133,17 @@ export declare function renderInternal<T>(element: React.ReactElement<T>, option
139
133
  queryAllByDisplayValue: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
140
134
  findByDisplayValue: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
141
135
  findAllByDisplayValue: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
136
+ getByTestId: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
137
+ getAllByTestId: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
138
+ queryByTestId: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
139
+ queryAllByTestId: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
140
+ findByTestId: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
141
+ findAllByTestId: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
142
+ getByText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
143
+ getAllByText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
144
+ queryByText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
145
+ queryAllByText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
146
+ findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
147
+ findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
142
148
  };
143
- export type DebugFunction = (options?: DebugOptions | string) => void;
149
+ export type DebugFunction = (options?: DebugOptions) => void;
package/build/render.js CHANGED
@@ -6,40 +6,43 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = render;
7
7
  exports.renderInternal = renderInternal;
8
8
  var React = _interopRequireWildcard(require("react"));
9
- var _reactNative = require("universal-test-renderer/react-native");
10
9
  var _act = _interopRequireDefault(require("./act"));
11
10
  var _cleanup = require("./cleanup");
12
11
  var _config = require("./config");
13
12
  var _debug = require("./helpers/debug");
13
+ var _renderAct = require("./render-act");
14
14
  var _screen = require("./screen");
15
15
  var _within = require("./within");
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
- 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); }
18
- 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; }
17
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
18
  /**
20
19
  * Renders test component deeply using React Test Renderer and exposes helpers
21
20
  * to assert on the output.
22
21
  */
23
- function render(element, options = {}) {
24
- return renderInternal(element, options);
22
+ function render(component, options = {}) {
23
+ return renderInternal(component, options);
25
24
  }
26
- function renderInternal(element, options) {
25
+ function renderInternal(component, options) {
27
26
  const {
28
27
  wrapper: Wrapper
29
28
  } = options || {};
29
+
30
+ // TODO allow passing some options
31
+ const rendererOptions = {};
30
32
  const wrap = element => Wrapper ? /*#__PURE__*/React.createElement(Wrapper, null, element) : element;
31
- const renderer = (0, _reactNative.createRoot)({
32
- createNodeMock: options?.createNodeMock
33
- });
34
- void (0, _act.default)(() => {
35
- renderer.render(wrap(element));
36
- });
33
+ const renderer = (0, _renderAct.renderWithAct)(wrap(component), rendererOptions);
37
34
  return buildRenderResult(renderer, wrap);
38
35
  }
39
36
  function buildRenderResult(renderer, wrap) {
40
- const update = element => {
37
+ const rerender = component => {
41
38
  void (0, _act.default)(() => {
42
- renderer.render(wrap(element));
39
+ renderer.render(wrap(component));
40
+ });
41
+ };
42
+ const rerenderAsync = async component => {
43
+ // eslint-disable-next-line require-await
44
+ await (0, _act.default)(async () => {
45
+ renderer.render(wrap(component));
43
46
  });
44
47
  };
45
48
  const unmount = () => {
@@ -47,18 +50,34 @@ function buildRenderResult(renderer, wrap) {
47
50
  renderer.unmount();
48
51
  });
49
52
  };
50
- (0, _cleanup.addToCleanupQueue)(unmount);
53
+ const unmountAsync = async () => {
54
+ // eslint-disable-next-line require-await
55
+ await (0, _act.default)(async () => {
56
+ renderer.unmount();
57
+ });
58
+ };
59
+ (0, _cleanup.addToCleanupQueue)(unmountAsync);
51
60
  const result = {
52
61
  ...(0, _within.getQueriesForElement)(renderer.container),
53
- update,
62
+ rerender,
63
+ rerenderAsync,
64
+ update: rerender,
65
+ // alias for 'rerender'
66
+ updateAsync: rerenderAsync,
67
+ // alias for `rerenderAsync`
54
68
  unmount,
55
- rerender: update,
56
- // alias for `update`
57
- toJSON: () => renderer.root?.toJSON(),
69
+ unmountAsync,
70
+ toJSON: () => renderer.container.toJSON(),
58
71
  debug: makeDebug(renderer),
59
- container: renderer.container,
72
+ get container() {
73
+ return renderer.container;
74
+ },
60
75
  get root() {
61
- return renderer.root;
76
+ const firstChild = renderer.container.children[0];
77
+ if (typeof firstChild === 'string') {
78
+ throw new Error('Invariant Violation: Root element must be a host element. Detected attempt to render a string within the root element.');
79
+ }
80
+ return firstChild;
62
81
  }
63
82
  };
64
83
  (0, _screen.setRenderResult)(result);
@@ -69,18 +88,11 @@ function makeDebug(renderer) {
69
88
  const {
70
89
  defaultDebugOptions
71
90
  } = (0, _config.getConfig)();
72
- const debugOptions = typeof options === 'string' ? {
73
- ...defaultDebugOptions,
74
- message: options
75
- } : {
91
+ const debugOptions = {
76
92
  ...defaultDebugOptions,
77
93
  ...options
78
94
  };
79
- if (typeof options === 'string') {
80
- // eslint-disable-next-line no-console
81
- console.warn('Using debug("message") is deprecated and will be removed in future release, please use debug({ message: "message" }) instead.');
82
- }
83
- const json = renderer.root?.toJSON();
95
+ const json = renderer.container.toJSON();
84
96
  if (json) {
85
97
  return (0, _debug.debug)(json, debugOptions);
86
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","names":["React","_interopRequireWildcard","require","_reactNative","_act","_interopRequireDefault","_cleanup","_config","_debug","_screen","_within","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","render","element","options","renderInternal","wrapper","Wrapper","wrap","createElement","renderer","createRoot","createNodeMock","act","buildRenderResult","update","unmount","addToCleanupQueue","result","getQueriesForElement","container","rerender","toJSON","root","debug","makeDebug","setRenderResult","debugImpl","defaultDebugOptions","getConfig","debugOptions","message","console","warn","json"],"sources":["../src/render.tsx"],"sourcesContent":["import * as React from 'react';\nimport { createRoot, HostElement, Root } from 'universal-test-renderer/react-native';\nimport act from './act';\nimport { addToCleanupQueue } from './cleanup';\nimport { getConfig } from './config';\nimport { debug, DebugOptions } from './helpers/debug';\nimport { setRenderResult } from './screen';\nimport { getQueriesForElement } from './within';\n\nexport interface RenderOptions {\n /**\n * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating\n * reusable custom render functions for common data providers.\n */\n wrapper?: React.ComponentType<any>;\n createNodeMock?: (element: React.ReactElement) => object;\n}\n\nexport type RenderResult = ReturnType<typeof render>;\n\n/**\n * Renders test component deeply using React Test Renderer and exposes helpers\n * to assert on the output.\n */\nexport default function render<T>(element: React.ReactElement<T>, options: RenderOptions = {}) {\n return renderInternal(element, options);\n}\n\nexport function renderInternal<T>(element: React.ReactElement<T>, options?: RenderOptions) {\n const { wrapper: Wrapper } = options || {};\n\n const wrap = (element: React.ReactElement) => (Wrapper ? <Wrapper>{element}</Wrapper> : element);\n const renderer = createRoot({\n createNodeMock: options?.createNodeMock,\n });\n void act(() => {\n renderer.render(wrap(element));\n });\n\n return buildRenderResult(renderer, wrap);\n}\n\nfunction buildRenderResult(renderer: Root, wrap: (element: React.ReactElement) => JSX.Element) {\n const update = (element: React.ReactElement) => {\n void act(() => {\n renderer.render(wrap(element));\n });\n };\n\n const unmount = () => {\n void act(() => {\n renderer.unmount();\n });\n };\n\n addToCleanupQueue(unmount);\n\n const result = {\n ...getQueriesForElement(renderer.container),\n update,\n unmount,\n rerender: update, // alias for `update`\n toJSON: () => renderer.root?.toJSON(),\n debug: makeDebug(renderer),\n container: renderer.container,\n get root(): HostElement | null {\n return renderer.root;\n },\n };\n\n setRenderResult(result);\n return result;\n}\n\nexport type DebugFunction = (options?: DebugOptions | string) => void;\n\nfunction makeDebug(renderer: Root): DebugFunction {\n function debugImpl(options?: DebugOptions | string) {\n const { defaultDebugOptions } = getConfig();\n const debugOptions =\n typeof options === 'string'\n ? { ...defaultDebugOptions, message: options }\n : { ...defaultDebugOptions, ...options };\n\n if (typeof options === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n 'Using debug(\"message\") is deprecated and will be removed in future release, please use debug({ message: \"message\" }) instead.',\n );\n }\n\n const json = renderer.root?.toJSON();\n if (json) {\n return debug(json, debugOptions);\n }\n }\n\n return debugImpl;\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,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AQ,CAACa,IAAI,EAAED,MAAM,CAAC,CAAC;IACrCE,KAAK,EAAEC,SAAS,CAACf,QAAQ,CAAC;IAC1BU,SAAS,EAAEV,QAAQ,CAACU,SAAS;IAC7B,IAAIG,IAAIA,CAAA,EAAuB;MAC7B,OAAOb,QAAQ,CAACa,IAAI;IACtB;EACF,CAAC;EAED,IAAAG,uBAAe,EAACR,MAAM,CAAC;EACvB,OAAOA,MAAM;AACf;AAIA,SAASO,SAASA,CAACf,QAAc,EAAiB;EAChD,SAASiB,SAASA,CAACvB,OAA+B,EAAE;IAClD,MAAM;MAAEwB;IAAoB,CAAC,GAAG,IAAAC,iBAAS,EAAC,CAAC;IAC3C,MAAMC,YAAY,GAChB,OAAO1B,OAAO,KAAK,QAAQ,GACvB;MAAE,GAAGwB,mBAAmB;MAAEG,OAAO,EAAE3B;IAAQ,CAAC,GAC5C;MAAE,GAAGwB,mBAAmB;MAAE,GAAGxB;IAAQ,CAAC;IAE5C,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC/B;MACA4B,OAAO,CAACC,IAAI,CACV,+HACF,CAAC;IACH;IAEA,MAAMC,IAAI,GAAGxB,QAAQ,CAACa,IAAI,EAAED,MAAM,CAAC,CAAC;IACpC,IAAIY,IAAI,EAAE;MACR,OAAO,IAAAV,YAAK,EAACU,IAAI,EAAEJ,YAAY,CAAC;IAClC;EACF;EAEA,OAAOH,SAAS;AAClB","ignoreList":[]}
1
+ {"version":3,"file":"render.js","names":["React","_interopRequireWildcard","require","_act","_interopRequireDefault","_cleanup","_config","_debug","_renderAct","_screen","_within","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","render","component","options","renderInternal","wrapper","Wrapper","rendererOptions","wrap","element","createElement","renderer","renderWithAct","buildRenderResult","rerender","act","rerenderAsync","unmount","unmountAsync","addToCleanupQueue","result","getQueriesForElement","container","update","updateAsync","toJSON","debug","makeDebug","root","firstChild","children","Error","setRenderResult","debugImpl","defaultDebugOptions","getConfig","debugOptions","json"],"sources":["../src/render.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { HostElement, Root, RootOptions } from 'universal-test-renderer';\n\nimport act from './act';\nimport { addToCleanupQueue } from './cleanup';\nimport { getConfig } from './config';\nimport type { DebugOptions } from './helpers/debug';\nimport { debug } from './helpers/debug';\nimport { renderWithAct } from './render-act';\nimport { setRenderResult } from './screen';\nimport { getQueriesForElement } from './within';\n\nexport interface RenderOptions {\n /**\n * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating\n * reusable custom render functions for common data providers.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrapper?: React.ComponentType<any>;\n\n createNodeMock?: (element: React.ReactElement) => unknown;\n}\n\nexport type RenderResult = ReturnType<typeof render>;\n\n/**\n * Renders test component deeply using React Test Renderer and exposes helpers\n * to assert on the output.\n */\nexport default function render<T>(component: React.ReactElement<T>, options: RenderOptions = {}) {\n return renderInternal(component, options);\n}\n\nexport function renderInternal<T>(component: React.ReactElement<T>, options?: RenderOptions) {\n const { wrapper: Wrapper } = options || {};\n\n // TODO allow passing some options\n const rendererOptions: RootOptions = {};\n\n const wrap = (element: React.ReactElement) => (Wrapper ? <Wrapper>{element}</Wrapper> : element);\n const renderer = renderWithAct(wrap(component), rendererOptions);\n return buildRenderResult(renderer, wrap);\n}\n\nfunction buildRenderResult(\n renderer: Root,\n wrap: (element: React.ReactElement) => React.JSX.Element,\n) {\n const rerender = (component: React.ReactElement) => {\n void act(() => {\n renderer.render(wrap(component));\n });\n };\n const rerenderAsync = async (component: React.ReactElement) => {\n // eslint-disable-next-line require-await\n await act(async () => {\n renderer.render(wrap(component));\n });\n };\n\n const unmount = () => {\n void act(() => {\n renderer.unmount();\n });\n };\n const unmountAsync = async () => {\n // eslint-disable-next-line require-await\n await act(async () => {\n renderer.unmount();\n });\n };\n\n addToCleanupQueue(unmountAsync);\n\n const result = {\n ...getQueriesForElement(renderer.container),\n rerender,\n rerenderAsync,\n update: rerender, // alias for 'rerender'\n updateAsync: rerenderAsync, // alias for `rerenderAsync`\n unmount,\n unmountAsync,\n toJSON: () => renderer.container.toJSON(),\n debug: makeDebug(renderer),\n get container(): HostElement {\n return renderer.container;\n },\n get root(): HostElement | null {\n const firstChild = renderer.container.children[0];\n if (typeof firstChild === 'string') {\n throw new Error(\n 'Invariant Violation: Root element must be a host element. Detected attempt to render a string within the root element.',\n );\n }\n\n return firstChild;\n },\n };\n\n setRenderResult(result);\n\n return result;\n}\n\nexport type DebugFunction = (options?: DebugOptions) => void;\n\nfunction makeDebug(renderer: Root): DebugFunction {\n function debugImpl(options?: DebugOptions) {\n const { defaultDebugOptions } = getConfig();\n const debugOptions = { ...defaultDebugOptions, ...options };\n const json = renderer.container.toJSON();\n if (json) {\n return debug(json, debugOptions);\n }\n }\n return debugImpl;\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAgD,SAAAE,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,CAAAU,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SA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;MAC7B,MAAMC,UAAU,GAAGlB,QAAQ,CAACW,SAAS,CAACQ,QAAQ,CAAC,CAAC,CAAC;MACjD,IAAI,OAAOD,UAAU,KAAK,QAAQ,EAAE;QAClC,MAAM,IAAIE,KAAK,CACb,wHACF,CAAC;MACH;MAEA,OAAOF,UAAU;IACnB;EACF,CAAC;EAED,IAAAG,uBAAe,EAACZ,MAAM,CAAC;EAEvB,OAAOA,MAAM;AACf;AAIA,SAASO,SAASA,CAAChB,QAAc,EAAiB;EAChD,SAASsB,SAASA,CAAC9B,OAAsB,EAAE;IACzC,MAAM;MAAE+B;IAAoB,CAAC,GAAG,IAAAC,iBAAS,EAAC,CAAC;IAC3C,MAAMC,YAAY,GAAG;MAAE,GAAGF,mBAAmB;MAAE,GAAG/B;IAAQ,CAAC;IAC3D,MAAMkC,IAAI,GAAG1B,QAAQ,CAACW,SAAS,CAACG,MAAM,CAAC,CAAC;IACxC,IAAIY,IAAI,EAAE;MACR,OAAO,IAAAX,YAAK,EAACW,IAAI,EAAED,YAAY,CAAC;IAClC;EACF;EACA,OAAOH,SAAS;AAClB","ignoreList":[]}
package/build/screen.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { RenderResult } from './render';
1
+ import type { RenderResult } from './render';
2
2
  interface Screen extends RenderResult {
3
3
  isDetached?: boolean;
4
4
  }
package/build/screen.js CHANGED
@@ -10,21 +10,21 @@ const SCREEN_ERROR = '`render` method has not been called';
10
10
  const notImplemented = () => {
11
11
  throw new Error(SCREEN_ERROR);
12
12
  };
13
- const notImplementedDebug = () => {
14
- throw new Error(SCREEN_ERROR);
15
- };
16
13
  const defaultScreen = {
17
14
  isDetached: true,
18
- get root() {
15
+ get container() {
19
16
  throw new Error(SCREEN_ERROR);
20
17
  },
21
- get container() {
18
+ get root() {
22
19
  throw new Error(SCREEN_ERROR);
23
20
  },
24
- debug: notImplementedDebug,
21
+ debug: notImplemented,
22
+ rerender: notImplemented,
23
+ rerenderAsync: notImplemented,
25
24
  update: notImplemented,
25
+ updateAsync: notImplemented,
26
26
  unmount: notImplemented,
27
- rerender: notImplemented,
27
+ unmountAsync: notImplemented,
28
28
  toJSON: notImplemented,
29
29
  getByLabelText: notImplemented,
30
30
  getAllByLabelText: notImplemented,
@@ -1 +1 @@
1
- {"version":3,"file":"screen.js","names":["SCREEN_ERROR","notImplemented","Error","notImplementedDebug","defaultScreen","isDetached","root","container","debug","update","unmount","rerender","toJSON","getByLabelText","getAllByLabelText","queryByLabelText","queryAllByLabelText","findByLabelText","findAllByLabelText","getByHintText","getAllByHintText","queryByHintText","queryAllByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint","getByRole","getAllByRole","queryByRole","queryAllByRole","findByRole","findAllByRole","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","queryAllByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","queryAllByDisplayValue","findByDisplayValue","findAllByDisplayValue","getByTestId","getAllByTestId","queryByTestId","queryAllByTestId","findByTestId","findAllByTestId","getByText","getAllByText","queryByText","queryAllByText","findByText","findAllByText","screen","exports","setRenderResult","renderResult","clearRenderResult"],"sources":["../src/screen.ts"],"sourcesContent":["import { HostElement } from 'universal-test-renderer';\nimport { RenderResult } from './render';\n\nconst SCREEN_ERROR = '`render` method has not been called';\n\nconst notImplemented = () => {\n throw new Error(SCREEN_ERROR);\n};\n\nconst notImplementedDebug = () => {\n throw new Error(SCREEN_ERROR);\n};\n\ninterface Screen extends RenderResult {\n isDetached?: boolean;\n}\n\nconst defaultScreen: Screen = {\n isDetached: true,\n get root(): HostElement | null {\n throw new Error(SCREEN_ERROR);\n },\n get container(): HostElement {\n throw new Error(SCREEN_ERROR);\n },\n debug: notImplementedDebug,\n update: notImplemented,\n unmount: notImplemented,\n rerender: notImplemented,\n toJSON: notImplemented,\n getByLabelText: notImplemented,\n getAllByLabelText: notImplemented,\n queryByLabelText: notImplemented,\n queryAllByLabelText: notImplemented,\n findByLabelText: notImplemented,\n findAllByLabelText: notImplemented,\n getByHintText: notImplemented,\n getAllByHintText: notImplemented,\n queryByHintText: notImplemented,\n queryAllByHintText: notImplemented,\n findByHintText: notImplemented,\n findAllByHintText: notImplemented,\n getByA11yHint: notImplemented,\n getAllByA11yHint: notImplemented,\n queryByA11yHint: notImplemented,\n queryAllByA11yHint: notImplemented,\n findByA11yHint: notImplemented,\n findAllByA11yHint: notImplemented,\n getByAccessibilityHint: notImplemented,\n getAllByAccessibilityHint: notImplemented,\n queryByAccessibilityHint: notImplemented,\n queryAllByAccessibilityHint: notImplemented,\n findByAccessibilityHint: notImplemented,\n findAllByAccessibilityHint: notImplemented,\n getByRole: notImplemented,\n getAllByRole: notImplemented,\n queryByRole: notImplemented,\n queryAllByRole: notImplemented,\n findByRole: notImplemented,\n findAllByRole: notImplemented,\n getByPlaceholderText: notImplemented,\n getAllByPlaceholderText: notImplemented,\n queryByPlaceholderText: notImplemented,\n queryAllByPlaceholderText: notImplemented,\n findByPlaceholderText: notImplemented,\n findAllByPlaceholderText: notImplemented,\n getByDisplayValue: notImplemented,\n getAllByDisplayValue: notImplemented,\n queryByDisplayValue: notImplemented,\n queryAllByDisplayValue: notImplemented,\n findByDisplayValue: notImplemented,\n findAllByDisplayValue: notImplemented,\n getByTestId: notImplemented,\n getAllByTestId: notImplemented,\n queryByTestId: notImplemented,\n queryAllByTestId: notImplemented,\n findByTestId: notImplemented,\n findAllByTestId: notImplemented,\n getByText: notImplemented,\n getAllByText: notImplemented,\n queryByText: notImplemented,\n queryAllByText: notImplemented,\n findByText: notImplemented,\n findAllByText: notImplemented,\n};\n\nexport let screen: Screen = defaultScreen;\n\nexport function setRenderResult(renderResult: RenderResult) {\n screen = renderResult;\n}\n\nexport function clearRenderResult() {\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AA,EAAG;EAClCH,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAG/D,aAAa;AACxB","ignoreList":[]}
1
+ {"version":3,"file":"screen.js","names":["SCREEN_ERROR","notImplemented","Error","defaultScreen","isDetached","container","root","debug","rerender","rerenderAsync","update","updateAsync","unmount","unmountAsync","toJSON","getByLabelText","getAllByLabelText","queryByLabelText","queryAllByLabelText","findByLabelText","findAllByLabelText","getByHintText","getAllByHintText","queryByHintText","queryAllByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint","getByRole","getAllByRole","queryByRole","queryAllByRole","findByRole","findAllByRole","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","queryAllByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","queryAllByDisplayValue","findByDisplayValue","findAllByDisplayValue","getByTestId","getAllByTestId","queryByTestId","queryAllByTestId","findByTestId","findAllByTestId","getByText","getAllByText","queryByText","queryAllByText","findByText","findAllByText","screen","exports","setRenderResult","renderResult","clearRenderResult"],"sources":["../src/screen.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport type { RenderResult } from './render';\n\nconst SCREEN_ERROR = '`render` method has not been called';\n\nconst notImplemented = () => {\n throw new Error(SCREEN_ERROR);\n};\n\ninterface Screen extends RenderResult {\n isDetached?: boolean;\n}\n\nconst defaultScreen: Screen = {\n isDetached: true,\n get container(): HostElement {\n throw new Error(SCREEN_ERROR);\n },\n get root(): HostElement | null {\n throw new Error(SCREEN_ERROR);\n },\n debug: notImplemented,\n rerender: notImplemented,\n rerenderAsync: notImplemented,\n update: notImplemented,\n updateAsync: notImplemented,\n unmount: notImplemented,\n unmountAsync: notImplemented,\n toJSON: notImplemented,\n getByLabelText: notImplemented,\n getAllByLabelText: notImplemented,\n queryByLabelText: notImplemented,\n queryAllByLabelText: notImplemented,\n findByLabelText: notImplemented,\n findAllByLabelText: notImplemented,\n getByHintText: notImplemented,\n getAllByHintText: notImplemented,\n queryByHintText: notImplemented,\n queryAllByHintText: notImplemented,\n findByHintText: notImplemented,\n findAllByHintText: notImplemented,\n getByA11yHint: notImplemented,\n getAllByA11yHint: notImplemented,\n queryByA11yHint: notImplemented,\n queryAllByA11yHint: notImplemented,\n findByA11yHint: notImplemented,\n findAllByA11yHint: notImplemented,\n getByAccessibilityHint: notImplemented,\n getAllByAccessibilityHint: notImplemented,\n queryByAccessibilityHint: notImplemented,\n queryAllByAccessibilityHint: notImplemented,\n findByAccessibilityHint: notImplemented,\n findAllByAccessibilityHint: notImplemented,\n getByRole: notImplemented,\n getAllByRole: notImplemented,\n queryByRole: notImplemented,\n queryAllByRole: notImplemented,\n findByRole: notImplemented,\n findAllByRole: notImplemented,\n getByPlaceholderText: notImplemented,\n getAllByPlaceholderText: notImplemented,\n queryByPlaceholderText: notImplemented,\n queryAllByPlaceholderText: notImplemented,\n findByPlaceholderText: notImplemented,\n findAllByPlaceholderText: notImplemented,\n getByDisplayValue: notImplemented,\n getAllByDisplayValue: notImplemented,\n queryByDisplayValue: notImplemented,\n queryAllByDisplayValue: notImplemented,\n findByDisplayValue: notImplemented,\n findAllByDisplayValue: notImplemented,\n getByTestId: notImplemented,\n getAllByTestId: notImplemented,\n queryByTestId: notImplemented,\n queryAllByTestId: notImplemented,\n findByTestId: notImplemented,\n findAllByTestId: notImplemented,\n getByText: notImplemented,\n getAllByText: notImplemented,\n queryByText: notImplemented,\n queryAllByText: notImplemented,\n findByText: notImplemented,\n findAllByText: notImplemented,\n};\n\nexport let screen: Screen = defaultScreen;\n\nexport function setRenderResult(renderResult: RenderResult) {\n screen = renderResult;\n}\n\nexport function clearRenderResult() {\n screen = defaultScreen;\n}\n"],"mappings":";;;;;;;;AAIA,MAAMA,YAAY,GAAG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reList":[]}
@@ -0,0 +1 @@
1
+ export declare function excludeConsoleMessage(logFn: (...args: unknown[]) => void, excludeMessage: string): (...args: unknown[]) => void;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.excludeConsoleMessage = excludeConsoleMessage;
7
+ var _util = require("util");
8
+ function excludeConsoleMessage(logFn, excludeMessage) {
9
+ return (...args) => {
10
+ const message = (0, _util.format)(...args);
11
+ if (message.includes(excludeMessage)) {
12
+ return;
13
+ }
14
+ logFn(...args);
15
+ };
16
+ }
17
+ //# sourceMappingURL=console.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console.js","names":["_util","require","excludeConsoleMessage","logFn","excludeMessage","args","message","format","includes"],"sources":["../../src/test-utils/console.ts"],"sourcesContent":["import { format } from 'util';\n\nexport function excludeConsoleMessage(logFn: (...args: unknown[]) => void, excludeMessage: string) {\n return (...args: unknown[]) => {\n const message = format(...args);\n if (message.includes(excludeMessage)) {\n return;\n }\n\n logFn(...args);\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEO,SAASC,qBAAqBA,CAACC,KAAmC,EAAEC,cAAsB,EAAE;EACjG,OAAO,CAAC,GAAGC,IAAe,KAAK;IAC7B,MAAMC,OAAO,GAAG,IAAAC,YAAM,EAAC,GAAGF,IAAI,CAAC;IAC/B,IAAIC,OAAO,CAACE,QAAQ,CAACJ,cAAc,CAAC,EAAE;MACpC;IACF;IAEAD,KAAK,CAAC,GAAGE,IAAI,CAAC;EAChB,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ import type { JsonNode } from 'universal-test-renderer';
2
+ type JsonPropsMapper = {
3
+ [key: string]: unknown;
4
+ };
5
+ export declare function mapJsonProps<T extends JsonNode | JsonNode[] | null>(node: T, mapper: JsonPropsMapper): T;
6
+ export {};
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.mapJsonProps = mapJsonProps;
7
+ function mapJsonProps(node, mapper) {
8
+ if (Array.isArray(node)) {
9
+ return node.map(e => mapJsonProps(e, mapper));
10
+ }
11
+ if (!node || typeof node === 'string') {
12
+ return node;
13
+ }
14
+ const resultProps = {
15
+ ...node.props
16
+ };
17
+ Object.keys(mapper).forEach(key => {
18
+ if (key in node.props) {
19
+ resultProps[key] = mapper[key];
20
+ }
21
+ });
22
+
23
+ // @ts-expect-error: TODO fix type
24
+ const resultElement = {
25
+ ...node,
26
+ props: resultProps
27
+ };
28
+ Object.defineProperty(resultElement, '$$typeof', {
29
+ value: Symbol.for('react.test.json')
30
+ });
31
+ return resultElement;
32
+ }
33
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","names":["mapJsonProps","node","mapper","Array","isArray","map","e","resultProps","props","Object","keys","forEach","key","resultElement","defineProperty","value","Symbol","for"],"sources":["../../src/test-utils/json.ts"],"sourcesContent":["import type { JsonNode } from 'universal-test-renderer';\n\ntype JsonPropsMapper = {\n [key: string]: unknown;\n};\n\nexport function mapJsonProps<T extends JsonNode | JsonNode[] | null>(\n node: T,\n mapper: JsonPropsMapper,\n): T {\n if (Array.isArray(node)) {\n return node.map((e) => mapJsonProps(e, mapper)) as T;\n }\n\n if (!node || typeof node === 'string') {\n return node;\n }\n\n const resultProps: Record<string, unknown> = { ...node.props };\n Object.keys(mapper).forEach((key) => {\n if (key in node.props) {\n resultProps[key] = mapper[key];\n }\n });\n\n // @ts-expect-error: TODO fix type\n const resultElement = { ...node, props: resultProps };\n Object.defineProperty(resultElement, '$$typeof', {\n value: Symbol.for('react.test.json'),\n });\n\n return resultElement;\n}\n"],"mappings":";;;;;;AAMO,SAASA,YAAYA,CAC1BC,IAAO,EACPC,MAAuB,EACpB;EACH,IAAIC,KAAK,CAACC,OAAO,CAACH,IAAI,CAAC,EAAE;IACvB,OAAOA,IAAI,CAACI,GAAG,CAAEC,CAAC,IAAKN,YAAY,CAACM,CAAC,EAAEJ,MAAM,CAAC,CAAC;EACjD;EAEA,IAAI,CAACD,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IACrC,OAAOA,IAAI;EACb;EAEA,MAAMM,WAAoC,GAAG;IAAE,GAAGN,IAAI,CAACO;EAAM,CAAC;EAC9DC,MAAM,CAACC,IAAI,CAACR,MAAM,CAAC,CAACS,OAAO,CAAEC,GAAG,IAAK;IACnC,IAAIA,GAAG,IAAIX,IAAI,CAACO,KAAK,EAAE;MACrBD,WAAW,CAACK,GAAG,CAAC,GAAGV,MAAM,CAACU,GAAG,CAAC;IAChC;EACF,CAAC,CAAC;;EAEF;EACA,MAAMC,aAAa,GAAG;IAAE,GAAGZ,IAAI;IAAEO,KAAK,EAAED;EAAY,CAAC;EACrDE,MAAM,CAACK,cAAc,CAACD,aAAa,EAAE,UAAU,EAAE;IAC/CE,KAAK,EAAEC,MAAM,CAACC,GAAG,CAAC,iBAAiB;EACrC,CAAC,CAAC;EAEF,OAAOJ,aAAa;AACtB","ignoreList":[]}
@@ -1 +1 @@
1
- {"root":["../src/act.ts","../src/cleanup.ts","../src/config.ts","../src/fire-event.ts","../src/flush-micro-tasks.ts","../src/index.ts","../src/matches.ts","../src/native-state.ts","../src/pure.ts","../src/react-versions.ts","../src/render-hook.tsx","../src/render.tsx","../src/screen.ts","../src/types.ts","../src/wait-for-element-to-be-removed.ts","../src/wait-for.ts","../src/within.ts","../src/helpers/accessibility.ts","../src/helpers/component-tree.ts","../src/helpers/debug.ts","../src/helpers/errors.ts","../src/helpers/find-all.ts","../src/helpers/format-default.ts","../src/helpers/format.ts","../src/helpers/host-component-names.ts","../src/helpers/object.ts","../src/helpers/pointer-events.ts","../src/helpers/text-content.ts","../src/helpers/text-input.ts","../src/helpers/timers.ts","../src/helpers/wrap-async.ts","../src/helpers/matchers/match-accessibility-state.ts","../src/helpers/matchers/match-accessibility-value.ts","../src/helpers/matchers/match-array-prop.ts","../src/helpers/matchers/match-label-text.ts","../src/helpers/matchers/match-object-prop.ts","../src/helpers/matchers/match-string-prop.ts","../src/helpers/matchers/match-text-content.ts","../src/matchers/extend-expect.ts","../src/matchers/index.ts","../src/matchers/to-be-busy.ts","../src/matchers/to-be-checked.ts","../src/matchers/to-be-disabled.ts","../src/matchers/to-be-empty-element.ts","../src/matchers/to-be-expanded.ts","../src/matchers/to-be-on-the-screen.ts","../src/matchers/to-be-partially-checked.ts","../src/matchers/to-be-selected.ts","../src/matchers/to-be-visible.ts","../src/matchers/to-contain-element.ts","../src/matchers/to-have-accessibility-value.ts","../src/matchers/to-have-accessible-name.ts","../src/matchers/to-have-display-value.ts","../src/matchers/to-have-prop.ts","../src/matchers/to-have-style.ts","../src/matchers/to-have-text-content.ts","../src/matchers/types.ts","../src/matchers/utils.ts","../src/queries/display-value.ts","../src/queries/hint-text.ts","../src/queries/label-text.ts","../src/queries/make-queries.ts","../src/queries/options.ts","../src/queries/placeholder-text.ts","../src/queries/role.ts","../src/queries/test-id.ts","../src/queries/text.ts","../src/test-utils/events.ts","../src/test-utils/index.ts","../src/user-event/clear.ts","../src/user-event/index.ts","../src/user-event/paste.ts","../src/user-event/event-builder/base.ts","../src/user-event/event-builder/common.ts","../src/user-event/event-builder/index.ts","../src/user-event/event-builder/scroll-view.ts","../src/user-event/event-builder/text-input.ts","../src/user-event/press/index.ts","../src/user-event/press/press.ts","../src/user-event/scroll/index.ts","../src/user-event/scroll/scroll-to.ts","../src/user-event/scroll/utils.ts","../src/user-event/setup/index.ts","../src/user-event/setup/setup.ts","../src/user-event/type/index.ts","../src/user-event/type/parse-keys.ts","../src/user-event/type/type.ts","../src/user-event/utils/content-size.ts","../src/user-event/utils/dispatch-event.ts","../src/user-event/utils/index.ts","../src/user-event/utils/text-range.ts","../src/user-event/utils/wait.ts"],"version":"5.6.3"}
1
+ {"root":["../src/act.ts","../src/cleanup.ts","../src/config.ts","../src/event-handler.ts","../src/fire-event.ts","../src/flush-micro-tasks.ts","../src/index.ts","../src/matches.ts","../src/native-state.ts","../src/pure.ts","../src/react-versions.ts","../src/render-act.ts","../src/render-async.tsx","../src/render-hook.tsx","../src/render.tsx","../src/screen.ts","../src/types.ts","../src/wait-for-element-to-be-removed.ts","../src/wait-for.ts","../src/within.ts","../src/helpers/accessibility.ts","../src/helpers/component-tree.ts","../src/helpers/debug.ts","../src/helpers/errors.ts","../src/helpers/find-all.ts","../src/helpers/format-element.ts","../src/helpers/host-component-names.ts","../src/helpers/logger.ts","../src/helpers/map-props.ts","../src/helpers/object.ts","../src/helpers/pointer-events.ts","../src/helpers/text-content.ts","../src/helpers/text-input.ts","../src/helpers/timers.ts","../src/helpers/wrap-async.ts","../src/helpers/matchers/match-accessibility-state.ts","../src/helpers/matchers/match-accessibility-value.ts","../src/helpers/matchers/match-array-prop.ts","../src/helpers/matchers/match-label-text.ts","../src/helpers/matchers/match-object-prop.ts","../src/helpers/matchers/match-string-prop.ts","../src/helpers/matchers/match-text-content.ts","../src/matchers/extend-expect.ts","../src/matchers/index.ts","../src/matchers/to-be-busy.ts","../src/matchers/to-be-checked.ts","../src/matchers/to-be-disabled.ts","../src/matchers/to-be-empty-element.ts","../src/matchers/to-be-expanded.ts","../src/matchers/to-be-on-the-screen.ts","../src/matchers/to-be-partially-checked.ts","../src/matchers/to-be-selected.ts","../src/matchers/to-be-visible.ts","../src/matchers/to-contain-element.ts","../src/matchers/to-have-accessibility-value.ts","../src/matchers/to-have-accessible-name.ts","../src/matchers/to-have-display-value.ts","../src/matchers/to-have-prop.ts","../src/matchers/to-have-style.ts","../src/matchers/to-have-text-content.ts","../src/matchers/types.ts","../src/matchers/utils.ts","../src/queries/display-value.ts","../src/queries/hint-text.ts","../src/queries/label-text.ts","../src/queries/make-queries.ts","../src/queries/options.ts","../src/queries/placeholder-text.ts","../src/queries/role.ts","../src/queries/test-id.ts","../src/queries/text.ts","../src/test-utils/console.ts","../src/test-utils/events.ts","../src/test-utils/json.ts","../src/user-event/clear.ts","../src/user-event/index.ts","../src/user-event/paste.ts","../src/user-event/event-builder/base.ts","../src/user-event/event-builder/common.ts","../src/user-event/event-builder/index.ts","../src/user-event/event-builder/scroll-view.ts","../src/user-event/event-builder/text-input.ts","../src/user-event/press/index.ts","../src/user-event/press/press.ts","../src/user-event/scroll/index.ts","../src/user-event/scroll/scroll-to.ts","../src/user-event/scroll/utils.ts","../src/user-event/setup/index.ts","../src/user-event/setup/setup.ts","../src/user-event/type/index.ts","../src/user-event/type/parse-keys.ts","../src/user-event/type/type.ts","../src/user-event/utils/content-size.ts","../src/user-event/utils/dispatch-event.ts","../src/user-event/utils/index.ts","../src/user-event/utils/text-range.ts","../src/user-event/utils/wait.ts"],"version":"5.9.3"}
package/build/types.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /** `RefObject` type from React 19. */
2
+ export type RefObject<T> = {
3
+ current: T;
4
+ };
1
5
  /**
2
6
  * Location of an element.
3
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/**\n * Location of an element.\n */\nexport interface Point {\n y: number;\n x: number;\n}\n\n/**\n * Size of an element.\n */\nexport interface Size {\n height: number;\n width: number;\n}\n\n// TS autocomplete trick\n// Ref: https://github.com/microsoft/TypeScript/issues/29729#issuecomment-567871939\nexport type StringWithAutocomplete<T> = T | (string & {});\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/** `RefObject` type from React 19. */\nexport type RefObject<T> = {\n current: T;\n};\n\n/**\n * Location of an element.\n */\nexport interface Point {\n y: number;\n x: number;\n}\n\n/**\n * Size of an element.\n */\nexport interface Size {\n height: number;\n width: number;\n}\n\n// TS autocomplete trick\n// Ref: https://github.com/microsoft/TypeScript/issues/29729#issuecomment-567871939\nexport type StringWithAutocomplete<T> = T | (string & {});\n"],"mappings":"","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import { HostElement } from 'universal-test-renderer';
2
- import { UserEventInstance } from './setup';
1
+ import type { HostElement } from 'universal-test-renderer';
2
+ import type { UserEventInstance } from './setup';
3
3
  export declare function clear(this: UserEventInstance, element: HostElement): Promise<void>;