From 51b474ebdecefb9dfb4cd378f08020bc20af812e Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 5 Mar 2020 10:33:19 -0800 Subject: [PATCH] @testing-library__react: add debug options (#42837) * @testing-library__react: add debug options * Create package.json --- types/testing-library__react/index.d.ts | 7 ++++++- types/testing-library__react/package.json | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 types/testing-library__react/package.json diff --git a/types/testing-library__react/index.d.ts b/types/testing-library__react/index.d.ts index 5ac83afed5..fcea540f97 100644 --- a/types/testing-library__react/index.d.ts +++ b/types/testing-library__react/index.d.ts @@ -9,6 +9,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 +import { OptionsReceived as PrettyFormatOptions } from 'pretty-format'; import { queries, Queries, BoundFunction } from '@testing-library/dom'; import { act as reactAct } from 'react-dom/test-utils'; @@ -17,7 +18,11 @@ export * from '@testing-library/dom'; export type RenderResult = { container: HTMLElement; baseElement: HTMLElement; - debug: (baseElement?: HTMLElement | DocumentFragment | Array) => void; + debug: ( + baseElement?: HTMLElement | DocumentFragment | Array, + maxLength?: number, + options?: PrettyFormatOptions + ) => void; rerender: (ui: React.ReactElement) => void; unmount: () => boolean; asFragment: () => DocumentFragment; diff --git a/types/testing-library__react/package.json b/types/testing-library__react/package.json new file mode 100644 index 0000000000..a019c58ee7 --- /dev/null +++ b/types/testing-library__react/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "pretty-format": "^25.1.0" + } +}