diff --git a/typings/__tests__/index.test.tsx b/typings/__tests__/index.test.tsx index 5084ddf47..40341f84a 100644 --- a/typings/__tests__/index.test.tsx +++ b/typings/__tests__/index.test.tsx @@ -199,6 +199,8 @@ const findAllBy: Promise[] = [ // 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(); diff --git a/typings/index.d.ts b/typings/index.d.ts index 35399bb3b..43c536187 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -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 @@ -295,6 +298,11 @@ export interface RenderOptions { createNodeMock?: (element: React.ReactElement) => any; } +type Debug = { + (message?: string); + shallow: (message?: string) => void; +}; + type Queries = GetByAPI & QueryByAPI & FindByAPI & A11yAPI; export interface RenderAPI extends Queries { @@ -302,7 +310,7 @@ export interface RenderAPI extends Queries { rerender(nextElement: React.ReactElement): void; unmount(nextElement?: React.ReactElement): void; toJSON(): ReactTestRendererJSON | null; - debug(message?: string): void; + debug: Debug; container: ReactTestInstance; }