Skip to content

Commit b1b38b5

Browse files
alexkrolickKent C. Dodds
authored and
Kent C. Dodds
committed
fix: update getByTestId types (#74)
1 parent 5356f20 commit b1b38b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

typings/index.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import {Simulate as ReactSimulate} from 'react-dom/test-utils'
22

33
type TextMatchFunction = (content: string, element: HTMLElement) => boolean
44
type TextMatch = string | RegExp | TextMatchFunction
5+
type ExactTextMatch = string | RegExp | TextMatchFunction
56

67
interface RenderResult {
78
container: HTMLDivElement
89
rerender: (ui: React.ReactElement<any>) => void
910
unmount: VoidFunction
10-
queryByTestId: (id: TextMatch) => HTMLElement | null
11-
getByTestId: (id: TextMatch) => HTMLElement
11+
queryByTestId: (id: ExactTextMatch) => HTMLElement | null
12+
getByTestId: (id: ExactTextMatch) => HTMLElement
1213
queryByText: (id: TextMatch) => HTMLElement | null
1314
getByText: (text: TextMatch) => HTMLElement
1415
queryByPlaceholderText: (id: TextMatch) => HTMLElement | null

0 commit comments

Comments
 (0)