@testing-library__react: add debug options (#42837)

* @testing-library__react: add debug options

* Create package.json
This commit is contained in:
Andrew Casey 2020-03-05 10:33:19 -08:00 committed by GitHub
parent 48275bff65
commit 51b474ebde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -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<Q extends Queries = typeof queries> = {
container: HTMLElement;
baseElement: HTMLElement;
debug: (baseElement?: HTMLElement | DocumentFragment | Array<HTMLElement | DocumentFragment>) => void;
debug: (
baseElement?: HTMLElement | DocumentFragment | Array<HTMLElement | DocumentFragment>,
maxLength?: number,
options?: PrettyFormatOptions
) => void;
rerender: (ui: React.ReactElement) => void;
unmount: () => boolean;
asFragment: () => DocumentFragment;

View File

@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"pretty-format": "^25.1.0"
}
}