diff --git a/types/testing-library__react-hooks/index.d.ts b/types/testing-library__react-hooks/index.d.ts index 3e273488b8..d6a3daf40f 100644 --- a/types/testing-library__react-hooks/index.d.ts +++ b/types/testing-library__react-hooks/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for @testing-library/react-hooks 3.1 +// Type definitions for @testing-library/react-hooks 3.2 // Project: https://github.com/testing-library/react-hooks-testing-library // Definitions by: Michael Peyper +// Sarah Dayan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 @@ -17,9 +18,16 @@ export interface HookResult { readonly error: Error; } +export interface WaitOptions { + timeout?: number; + suppressErrors?: boolean; +} + export interface RenderHookResult { readonly result: HookResult; - readonly waitForNextUpdate: () => Promise; + readonly waitForNextUpdate: (options?: WaitOptions) => Promise; + readonly waitForValueToChange: (selector: () => any, options?: WaitOptions) => Promise; + readonly wait: (callback: () => boolean|void, options?: WaitOptions) => Promise; readonly unmount: () => boolean; readonly rerender: (newProps?: P) => void; }