Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions typings/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ const findAllBy: Promise<ReactTestInstance[]>[] = [
// debug API
const debugFn = tree.debug();
const debugFnWithMessage = tree.debug('my message');
const shallowDebug = tree.debug.shallow();
const shallowDebugWithMessage = tree.debug.shallow('my message');

// update API
tree.update(<View />);
Expand Down
12 changes: 10 additions & 2 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ interface FindByAPI {
value: string | RegExp,
waitForOptions?: WaitForOptions
) => FindReturn;
findByTestId: (testID: string | RegExp, waitForOptions?: WaitForOptions) => FindReturn;
findByTestId: (
testID: string | RegExp,
waitForOptions?: WaitForOptions
) => FindReturn;
findAllByText: (
text: string | RegExp,
waitForOptions?: WaitForOptions
Expand Down Expand Up @@ -295,14 +298,19 @@ export interface RenderOptions {
createNodeMock?: (element: React.ReactElement<any>) => any;
}

type Debug = {
(message?: string);
shallow: (message?: string) => void;
};

type Queries = GetByAPI & QueryByAPI & FindByAPI & A11yAPI;

export interface RenderAPI extends Queries {
update(nextElement: React.ReactElement<any>): void;
rerender(nextElement: React.ReactElement<any>): void;
unmount(nextElement?: React.ReactElement<any>): void;
toJSON(): ReactTestRendererJSON | null;
debug(message?: string): void;
debug: Debug;
container: ReactTestInstance;
}

Expand Down