Skip to content

Commit dc03098

Browse files
committed
Fix type-test
1 parent ffa2221 commit dc03098

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

types/index.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
BoundFunction,
77
prettyFormat,
88
} from '@testing-library/dom'
9+
import React from 'react'
910
import {Renderer} from 'react-dom'
1011
import {act as reactAct} from 'react-dom/test-utils'
1112

@@ -70,9 +71,7 @@ export interface RenderOptions<
7071
*
7172
* @see https://testing-library.com/docs/react-testing-library/api/#wrapper
7273
*/
73-
wrapper?:
74-
| React.ComponentType
75-
| ((props: {children: React.ReactNode}) => JSX.Element)
74+
wrapper?: React.ComponentType<{children: React.ReactElement}>
7675
}
7776

7877
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>

types/test.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ export function wrappedRender(
111111
return pure.render(ui, {wrapper: Wrapper, ...options})
112112
}
113113

114+
export function wrappedRenderB(
115+
ui: React.ReactElement,
116+
options?: pure.RenderOptions,
117+
) {
118+
const Wrapper: React.FunctionComponent = ({children}) => {
119+
return <div>{children}</div>
120+
}
121+
122+
return pure.render(ui, {wrapper: Wrapper, ...options})
123+
}
124+
114125
/*
115126
eslint
116127
testing-library/prefer-explicit-assert: "off",

0 commit comments

Comments
 (0)