Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

Commit dd03c5c

Browse files
author
Brandon Carroll
committed
fix(types): fix a few more TestRenderer mismatches
1 parent 61f8438 commit dd03c5c

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

typings/index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ReactElement, ComponentType } from 'react';
2-
import { ReactTestRenderer } from 'react-test-renderer';
32

43
import * as queries from './queries';
54
import * as queryHelpers from './query-helpers';
@@ -10,7 +9,7 @@ import { getQueriesForElement, BoundFunction } from './get-queries-for-element';
109
declare const within: typeof getQueriesForElement;
1110

1211
interface Query extends Function {
13-
(testRenderer: ReactTestRenderer, ...args: any[]):
12+
(container: NativeTestInstance, ...args: any[]):
1413
| Error
1514
| Promise<NativeTestInstance[]>
1615
| Promise<NativeTestInstance>

typings/pretty-print.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { ReactTestRenderer } from 'react-test-renderer';
2-
31
import { NativeTestInstance } from './query-helpers';
42

53
export function prettyPrint(
6-
element: ReactTestRenderer | NativeTestInstance | string,
4+
element: NativeTestInstance | string,
75
maxLength?: number,
86
): string | false;

typings/query-helpers.d.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReactTestRenderer, ReactTestInstance } from 'react-test-renderer';
1+
import { ReactTestInstance } from 'react-test-renderer';
22

33
import { Matcher, MatcherOptions } from './matches';
44

@@ -19,24 +19,20 @@ export type NativeTestInstance = Omit<
1919

2020
export type QueryByProp = (
2121
attribute: string,
22-
testRenderer: ReactTestRenderer,
22+
container: NativeTestInstance,
2323
match: Matcher,
2424
options?: MatcherOptions,
2525
) => NativeTestInstance | null;
2626

2727
export type AllByProp = (
2828
attribute: string,
29-
testRenderer: HTMLElement,
29+
container: HTMLElement,
3030
id: Matcher,
3131
options?: MatcherOptions,
3232
) => NativeTestInstance[];
3333

3434
// TODO: finish types of the rest of the helpers
35-
export const defaultFilter: (node: NativeTestInstance) => boolean;
36-
export const getContainer: (
37-
testRenderer: ReactTestRenderer | ReactTestInstance,
38-
) => ReactTestInstance;
39-
export const getElementError: (message: string, testRenderer: ReactTestRenderer) => Error;
35+
export const getElementError: (message: string, container: NativeTestInstance) => Error;
4036
export const queryAllByProp: AllByProp;
4137
export const queryByProp: QueryByProp;
4238
export const proxyElement: (node: ReactTestInstance) => NativeTestInstance;

0 commit comments

Comments
 (0)