@@ -13,27 +13,41 @@ import { renderWithAct } from './render-act';
13
13
import { setRenderResult , screen } from './screen' ;
14
14
import { getQueriesForElement } from './within' ;
15
15
16
- export type RenderOptions = {
16
+ export interface RenderOptions {
17
17
wrapper ?: React . ComponentType < any > ;
18
18
createNodeMock ?: ( element : React . ReactElement ) => any ;
19
19
unstable_validateStringsRenderedWithinText ?: boolean ;
20
- } ;
20
+ }
21
21
22
22
export type RenderResult = ReturnType < typeof render > ;
23
23
24
24
/**
25
- * Renders test component deeply using react-test-renderer and exposes helpers
25
+ * Renders test component deeply using React Test Renderer and exposes helpers
26
26
* to assert on the output.
27
27
*/
28
28
export default function render < T > (
29
+ component : React . ReactElement < T > ,
30
+ options : RenderOptions = { }
31
+ ) {
32
+ return renderInternal ( component , options ) ;
33
+ }
34
+
35
+ export interface RenderInternalOptions extends RenderOptions {
36
+ detectHostComponentNames ?: boolean ;
37
+ }
38
+
39
+ export function renderInternal < T > (
29
40
component : React . ReactElement < T > ,
30
41
{
31
42
wrapper : Wrapper ,
32
43
createNodeMock,
33
44
unstable_validateStringsRenderedWithinText,
34
- } : RenderOptions = { }
45
+ detectHostComponentNames = true ,
46
+ } : RenderInternalOptions = { }
35
47
) {
36
- configureHostComponentNamesIfNeeded ( ) ;
48
+ if ( detectHostComponentNames ) {
49
+ configureHostComponentNamesIfNeeded ( ) ;
50
+ }
37
51
38
52
if ( unstable_validateStringsRenderedWithinText ) {
39
53
return renderWithStringValidation ( component , {
0 commit comments