@testing-library/react-native 14.0.0-alpha.5 → 14.0.0-alpha.6

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 (123) hide show
  1. package/README.md +2 -2
  2. package/build/act.d.ts +0 -3
  3. package/build/act.js +2 -3
  4. package/build/act.js.map +1 -1
  5. package/build/fire-event.d.ts +2 -9
  6. package/build/fire-event.js +0 -27
  7. package/build/fire-event.js.map +1 -1
  8. package/build/helpers/accessibility.d.ts +1 -1
  9. package/build/helpers/accessibility.js.map +1 -1
  10. package/build/helpers/component-tree.d.ts +1 -1
  11. package/build/helpers/component-tree.js.map +1 -1
  12. package/build/helpers/debug.d.ts +1 -1
  13. package/build/helpers/debug.js.map +1 -1
  14. package/build/helpers/find-all.d.ts +1 -1
  15. package/build/helpers/find-all.js.map +1 -1
  16. package/build/helpers/format-element.d.ts +1 -1
  17. package/build/helpers/format-element.js.map +1 -1
  18. package/build/helpers/host-component-names.d.ts +1 -1
  19. package/build/helpers/host-component-names.js.map +1 -1
  20. package/build/helpers/matchers/match-accessibility-state.d.ts +1 -1
  21. package/build/helpers/matchers/match-accessibility-state.js.map +1 -1
  22. package/build/helpers/matchers/match-accessibility-value.d.ts +1 -1
  23. package/build/helpers/matchers/match-accessibility-value.js.map +1 -1
  24. package/build/helpers/matchers/match-label-text.d.ts +1 -1
  25. package/build/helpers/matchers/match-label-text.js.map +1 -1
  26. package/build/helpers/matchers/match-text-content.d.ts +1 -1
  27. package/build/helpers/matchers/match-text-content.js.map +1 -1
  28. package/build/helpers/pointer-events.d.ts +1 -1
  29. package/build/helpers/pointer-events.js.map +1 -1
  30. package/build/helpers/text-content.d.ts +1 -1
  31. package/build/helpers/text-content.js.map +1 -1
  32. package/build/helpers/text-input.d.ts +1 -1
  33. package/build/helpers/text-input.js.map +1 -1
  34. package/build/matchers/to-be-busy.d.ts +1 -1
  35. package/build/matchers/to-be-busy.js.map +1 -1
  36. package/build/matchers/to-be-checked.d.ts +1 -1
  37. package/build/matchers/to-be-checked.js.map +1 -1
  38. package/build/matchers/to-be-disabled.d.ts +1 -1
  39. package/build/matchers/to-be-disabled.js.map +1 -1
  40. package/build/matchers/to-be-empty-element.d.ts +1 -1
  41. package/build/matchers/to-be-empty-element.js.map +1 -1
  42. package/build/matchers/to-be-expanded.d.ts +1 -1
  43. package/build/matchers/to-be-expanded.js.map +1 -1
  44. package/build/matchers/to-be-on-the-screen.d.ts +1 -1
  45. package/build/matchers/to-be-on-the-screen.js.map +1 -1
  46. package/build/matchers/to-be-partially-checked.d.ts +1 -1
  47. package/build/matchers/to-be-partially-checked.js.map +1 -1
  48. package/build/matchers/to-be-selected.d.ts +1 -1
  49. package/build/matchers/to-be-selected.js.map +1 -1
  50. package/build/matchers/to-be-visible.d.ts +1 -1
  51. package/build/matchers/to-be-visible.js.map +1 -1
  52. package/build/matchers/to-contain-element.d.ts +1 -1
  53. package/build/matchers/to-contain-element.js.map +1 -1
  54. package/build/matchers/to-have-accessibility-value.d.ts +1 -1
  55. package/build/matchers/to-have-accessibility-value.js.map +1 -1
  56. package/build/matchers/to-have-accessible-name.d.ts +1 -1
  57. package/build/matchers/to-have-accessible-name.js.map +1 -1
  58. package/build/matchers/to-have-display-value.d.ts +1 -1
  59. package/build/matchers/to-have-display-value.js.map +1 -1
  60. package/build/matchers/to-have-prop.d.ts +1 -1
  61. package/build/matchers/to-have-prop.js.map +1 -1
  62. package/build/matchers/to-have-style.d.ts +1 -1
  63. package/build/matchers/to-have-style.js.map +1 -1
  64. package/build/matchers/to-have-text-content.d.ts +1 -1
  65. package/build/matchers/to-have-text-content.js.map +1 -1
  66. package/build/matchers/types.d.ts +1 -1
  67. package/build/matchers/types.js.map +1 -1
  68. package/build/matchers/utils.d.ts +1 -1
  69. package/build/matchers/utils.js.map +1 -1
  70. package/build/native-state.d.ts +1 -1
  71. package/build/native-state.js.map +1 -1
  72. package/build/pure.d.ts +5 -7
  73. package/build/pure.js +0 -31
  74. package/build/pure.js.map +1 -1
  75. package/build/queries/display-value.d.ts +1 -1
  76. package/build/queries/display-value.js.map +1 -1
  77. package/build/queries/hint-text.d.ts +1 -1
  78. package/build/queries/hint-text.js.map +1 -1
  79. package/build/queries/label-text.d.ts +1 -1
  80. package/build/queries/label-text.js.map +1 -1
  81. package/build/queries/make-queries.d.ts +1 -1
  82. package/build/queries/make-queries.js.map +1 -1
  83. package/build/queries/placeholder-text.d.ts +1 -1
  84. package/build/queries/placeholder-text.js.map +1 -1
  85. package/build/queries/role.d.ts +1 -1
  86. package/build/queries/role.js.map +1 -1
  87. package/build/queries/test-id.d.ts +1 -1
  88. package/build/queries/test-id.js.map +1 -1
  89. package/build/queries/text.d.ts +1 -1
  90. package/build/queries/text.js.map +1 -1
  91. package/build/render-hook.d.ts +0 -8
  92. package/build/render-hook.js +0 -38
  93. package/build/render-hook.js.map +1 -1
  94. package/build/render.d.ts +1 -2
  95. package/build/render.js +7 -6
  96. package/build/render.js.map +1 -1
  97. package/build/screen.js +0 -1
  98. package/build/screen.js.map +1 -1
  99. package/build/test-utils/json.d.ts +1 -1
  100. package/build/test-utils/json.js.map +1 -1
  101. package/build/tsconfig.release.tsbuildinfo +1 -1
  102. package/build/user-event/clear.d.ts +1 -1
  103. package/build/user-event/clear.js.map +1 -1
  104. package/build/user-event/index.d.ts +1 -1
  105. package/build/user-event/index.js.map +1 -1
  106. package/build/user-event/paste.d.ts +1 -1
  107. package/build/user-event/paste.js.map +1 -1
  108. package/build/user-event/press/press.d.ts +1 -1
  109. package/build/user-event/press/press.js.map +1 -1
  110. package/build/user-event/scroll/scroll-to.d.ts +1 -1
  111. package/build/user-event/scroll/scroll-to.js.map +1 -1
  112. package/build/user-event/setup/setup.d.ts +1 -1
  113. package/build/user-event/setup/setup.js.map +1 -1
  114. package/build/user-event/type/type.d.ts +1 -1
  115. package/build/user-event/type/type.js.map +1 -1
  116. package/build/user-event/utils/dispatch-event.d.ts +1 -1
  117. package/build/user-event/utils/dispatch-event.js.map +1 -1
  118. package/build/within.d.ts +1 -1
  119. package/build/within.js.map +1 -1
  120. package/package.json +11 -10
  121. package/build/unsafe-render-sync.d.ts +0 -144
  122. package/build/unsafe-render-sync.js +0 -114
  123. package/build/unsafe-render-sync.js.map +0 -1
@@ -1,144 +0,0 @@
1
- import * as React from 'react';
2
- import { type HostElement, type JsonElement } from 'universal-test-renderer';
3
- import type { DebugOptions } from './helpers/debug';
4
- export interface RenderSyncOptions {
5
- /**
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.
8
- */
9
- wrapper?: React.ComponentType<any>;
10
- createNodeMock?: (element: React.ReactElement) => object;
11
- }
12
- /**
13
- * @deprecated Use `render` (async) instead. This function is provided for migration purposes only.
14
- * Renders test component deeply using React Test Renderer and exposes helpers
15
- * to assert on the output.
16
- */
17
- export declare function unsafe_renderSync<T>(component: React.ReactElement<T>, options?: RenderSyncOptions): {
18
- rerender: (component: React.ReactElement) => void;
19
- update: (component: React.ReactElement) => void;
20
- unmount: () => void;
21
- toJSON: () => JsonElement | null;
22
- debug: DebugFunction;
23
- container: HostElement;
24
- root: HostElement | null;
25
- getByRole: import("./queries/make-queries").GetByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
26
- getAllByRole: import("./queries/make-queries").GetAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
27
- queryByRole: import("./queries/make-queries").QueryByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
28
- queryAllByRole: import("./queries/make-queries").QueryAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
29
- findByRole: import("./queries/make-queries").FindByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
30
- findAllByRole: import("./queries/make-queries").FindAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
31
- getByHintText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
32
- getAllByHintText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
33
- queryByHintText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
34
- queryAllByHintText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
35
- findByHintText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
36
- findAllByHintText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
37
- getByA11yHint: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
38
- getAllByA11yHint: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
39
- queryByA11yHint: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
40
- queryAllByA11yHint: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
41
- findByA11yHint: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
42
- findAllByA11yHint: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
43
- getByAccessibilityHint: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
44
- getAllByAccessibilityHint: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
45
- queryByAccessibilityHint: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
46
- queryAllByAccessibilityHint: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
47
- findByAccessibilityHint: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
48
- findAllByAccessibilityHint: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
49
- getByLabelText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
50
- getAllByLabelText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
51
- queryByLabelText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
52
- queryAllByLabelText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
53
- findByLabelText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
54
- findAllByLabelText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
55
- getByPlaceholderText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
56
- getAllByPlaceholderText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
57
- queryByPlaceholderText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
58
- queryAllByPlaceholderText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
59
- findByPlaceholderText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
60
- findAllByPlaceholderText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
61
- getByDisplayValue: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
62
- getAllByDisplayValue: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
63
- queryByDisplayValue: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
64
- queryAllByDisplayValue: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
65
- findByDisplayValue: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
66
- findAllByDisplayValue: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
67
- getByTestId: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
68
- getAllByTestId: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
69
- queryByTestId: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
70
- queryAllByTestId: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
71
- findByTestId: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
72
- findAllByTestId: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
73
- getByText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
74
- getAllByText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
75
- queryByText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
76
- queryAllByText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
77
- findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
78
- findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
79
- };
80
- export type RenderSyncResult = ReturnType<typeof unsafe_renderSync>;
81
- export declare function renderInternal<T>(component: React.ReactElement<T>, options?: RenderSyncOptions): {
82
- rerender: (component: React.ReactElement) => void;
83
- update: (component: React.ReactElement) => void;
84
- unmount: () => void;
85
- toJSON: () => JsonElement | null;
86
- debug: DebugFunction;
87
- container: HostElement;
88
- root: HostElement | null;
89
- getByRole: import("./queries/make-queries").GetByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
90
- getAllByRole: import("./queries/make-queries").GetAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
91
- queryByRole: import("./queries/make-queries").QueryByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
92
- queryAllByRole: import("./queries/make-queries").QueryAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
93
- findByRole: import("./queries/make-queries").FindByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
94
- findAllByRole: import("./queries/make-queries").FindAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
95
- getByHintText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
96
- getAllByHintText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
97
- queryByHintText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
98
- queryAllByHintText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
99
- findByHintText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
100
- findAllByHintText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
101
- getByA11yHint: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
102
- getAllByA11yHint: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
103
- queryByA11yHint: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
104
- queryAllByA11yHint: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
105
- findByA11yHint: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
106
- findAllByA11yHint: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
107
- getByAccessibilityHint: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
108
- getAllByAccessibilityHint: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
109
- queryByAccessibilityHint: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
110
- queryAllByAccessibilityHint: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
111
- findByAccessibilityHint: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
112
- findAllByAccessibilityHint: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
113
- getByLabelText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
114
- getAllByLabelText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
115
- queryByLabelText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
116
- queryAllByLabelText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
117
- findByLabelText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
118
- findAllByLabelText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
119
- getByPlaceholderText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
120
- getAllByPlaceholderText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
121
- queryByPlaceholderText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
122
- queryAllByPlaceholderText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
123
- findByPlaceholderText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
124
- findAllByPlaceholderText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
125
- getByDisplayValue: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
126
- getAllByDisplayValue: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
127
- queryByDisplayValue: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
128
- queryAllByDisplayValue: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
129
- findByDisplayValue: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
130
- findAllByDisplayValue: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
131
- getByTestId: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
132
- getAllByTestId: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
133
- queryByTestId: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
134
- queryAllByTestId: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
135
- findByTestId: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
136
- findAllByTestId: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
137
- getByText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
138
- getAllByText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
139
- queryByText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
140
- queryAllByText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
141
- findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
142
- findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
143
- };
144
- export type DebugFunction = (options?: DebugOptions) => void;
@@ -1,114 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.renderInternal = renderInternal;
7
- exports.unsafe_renderSync = unsafe_renderSync;
8
- var React = _interopRequireWildcard(require("react"));
9
- var _universalTestRenderer = require("universal-test-renderer");
10
- var _act = require("./act");
11
- var _cleanup = require("./cleanup");
12
- var _config = require("./config");
13
- var _debug = require("./helpers/debug");
14
- var _hostComponentNames = require("./helpers/host-component-names");
15
- var _screen = require("./screen");
16
- var _within = require("./within");
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); }
18
- /**
19
- * @deprecated Use `render` (async) instead. This function is provided for migration purposes only.
20
- * Renders test component deeply using React Test Renderer and exposes helpers
21
- * to assert on the output.
22
- */
23
- function unsafe_renderSync(component, options = {}) {
24
- return renderInternal(component, options);
25
- }
26
- function renderInternal(component, options) {
27
- const {
28
- wrapper: Wrapper,
29
- createNodeMock
30
- } = options || {};
31
- const rendererOptions = {
32
- textComponents: _hostComponentNames.HOST_TEXT_NAMES,
33
- createNodeMock
34
- };
35
- const wrap = element => Wrapper ? /*#__PURE__*/React.createElement(Wrapper, null, element) : element;
36
- const renderer = (0, _universalTestRenderer.createRoot)(rendererOptions);
37
- (0, _act.unsafe_act)(() => {
38
- renderer.render(wrap(component));
39
- });
40
- const rerender = component => {
41
- (0, _act.unsafe_act)(() => {
42
- renderer.render(wrap(component));
43
- });
44
- };
45
- const rerenderAsync = async component => {
46
- await (0, _act.act)(() => {
47
- renderer.render(wrap(component));
48
- });
49
- };
50
- const unmount = () => {
51
- (0, _act.unsafe_act)(() => {
52
- renderer.unmount();
53
- });
54
- };
55
- const unmountAsync = async () => {
56
- await (0, _act.act)(() => {
57
- renderer.unmount();
58
- });
59
- };
60
- const toJSON = () => {
61
- const json = renderer.container.toJSON();
62
- if (json?.children?.length === 0) {
63
- return null;
64
- }
65
- if (json?.children?.length === 1 && typeof json.children[0] !== 'string') {
66
- return json.children[0];
67
- }
68
- return json;
69
- };
70
- (0, _cleanup.addToCleanupQueue)(unmountAsync);
71
- const result = {
72
- ...(0, _within.getQueriesForElement)(renderer.container),
73
- rerender,
74
- update: rerender,
75
- // alias for 'rerender'
76
- unmount,
77
- toJSON,
78
- debug: makeDebug(renderer),
79
- get container() {
80
- return renderer.container;
81
- },
82
- get root() {
83
- const firstChild = renderer.container.children[0];
84
- if (typeof firstChild === 'string') {
85
- throw new Error('Invariant Violation: Root element must be a host element. Detected attempt to render a string within the root element.');
86
- }
87
- return firstChild;
88
- }
89
- };
90
- (0, _screen.setRenderResult)({
91
- ...result,
92
- rerender: rerenderAsync,
93
- update: rerenderAsync,
94
- unmount: unmountAsync
95
- });
96
- return result;
97
- }
98
- function makeDebug(renderer) {
99
- function debugImpl(options) {
100
- const {
101
- defaultDebugOptions
102
- } = (0, _config.getConfig)();
103
- const debugOptions = {
104
- ...defaultDebugOptions,
105
- ...options
106
- };
107
- const json = renderer.container.toJSON();
108
- if (json) {
109
- return (0, _debug.debug)(json, debugOptions);
110
- }
111
- }
112
- return debugImpl;
113
- }
114
- //# sourceMappingURL=unsafe-render-sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unsafe-render-sync.js","names":["React","_interopRequireWildcard","require","_universalTestRenderer","_act","_cleanup","_config","_debug","_hostComponentNames","_screen","_within","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","unsafe_renderSync","component","options","renderInternal","wrapper","Wrapper","createNodeMock","rendererOptions","textComponents","HOST_TEXT_NAMES","wrap","element","createElement","renderer","createRoot","unsafe_act","render","rerender","rerenderAsync","act","unmount","unmountAsync","toJSON","json","container","children","length","addToCleanupQueue","result","getQueriesForElement","update","debug","makeDebug","root","firstChild","Error","setRenderResult","debugImpl","defaultDebugOptions","getConfig","debugOptions"],"sources":["../src/unsafe-render-sync.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n createRoot,\n type HostElement,\n type JsonElement,\n type Root,\n type RootOptions,\n} from 'universal-test-renderer';\n\nimport { act, unsafe_act } from './act';\nimport { addToCleanupQueue } from './cleanup';\nimport { getConfig } from './config';\nimport type { DebugOptions } from './helpers/debug';\nimport { debug } from './helpers/debug';\nimport { HOST_TEXT_NAMES } from './helpers/host-component-names';\nimport { setRenderResult } from './screen';\nimport { getQueriesForElement } from './within';\n\nexport interface RenderSyncOptions {\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) => object;\n}\n\n/**\n * @deprecated Use `render` (async) instead. This function is provided for migration purposes only.\n * Renders test component deeply using React Test Renderer and exposes helpers\n * to assert on the output.\n */\nexport function unsafe_renderSync<T>(\n component: React.ReactElement<T>,\n options: RenderSyncOptions = {},\n) {\n return renderInternal(component, options);\n}\n\nexport type RenderSyncResult = ReturnType<typeof unsafe_renderSync>;\n\nexport function renderInternal<T>(component: React.ReactElement<T>, options?: RenderSyncOptions) {\n const { wrapper: Wrapper, createNodeMock } = options || {};\n\n const rendererOptions: RootOptions = {\n textComponents: HOST_TEXT_NAMES,\n createNodeMock,\n };\n\n const wrap = (element: React.ReactElement) => (Wrapper ? <Wrapper>{element}</Wrapper> : element);\n\n const renderer = createRoot(rendererOptions);\n\n unsafe_act(() => {\n renderer.render(wrap(component));\n });\n\n const rerender = (component: React.ReactElement) => {\n unsafe_act(() => {\n renderer.render(wrap(component));\n });\n };\n\n const rerenderAsync = async (component: React.ReactElement) => {\n await act(() => {\n renderer.render(wrap(component));\n });\n };\n\n const unmount = () => {\n unsafe_act(() => {\n renderer.unmount();\n });\n };\n\n const unmountAsync = async () => {\n await act(() => {\n renderer.unmount();\n });\n };\n\n const toJSON = (): JsonElement | null => {\n const json = renderer.container.toJSON();\n if (json?.children?.length === 0) {\n return null;\n }\n\n if (json?.children?.length === 1 && typeof json.children[0] !== 'string') {\n return json.children[0];\n }\n\n return json;\n };\n\n addToCleanupQueue(unmountAsync);\n\n const result = {\n ...getQueriesForElement(renderer.container),\n rerender,\n update: rerender, // alias for 'rerender'\n unmount,\n 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({\n ...result,\n rerender: rerenderAsync,\n update: rerenderAsync,\n unmount: unmountAsync,\n });\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;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAQA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAgD,SAAAD,wBAAAU,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,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