0.9.5 • Published 6 months ago
@types/enzyme-async-helpers v0.9.5
Installation
npm install --save @types/enzyme-async-helpers
Summary
This package contains type definitions for enzyme-async-helpers (https://github.com/zth/enzyme-async-helpers).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/enzyme-async-helpers.
index.d.ts
// Type definitions for enzyme-async-helpers 0.9
// Project: https://github.com/zth/enzyme-async-helpers
// Definitions by: Kim Ehrenpohl <https://github.com/kimehrenpohl>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.1
import { ReactWrapper, EnzymeSelector } from 'enzyme';
export function waitForState(
wrapper: ReactWrapper,
stateValidationFn: (state: object) => boolean,
config?: Config
): Promise<void>;
export function waitForElement(
wrapper: ReactWrapper,
elementSelector: EnzymeSelector,
config?: Config
): Promise<void>;
export function waitForProps(
wrapper: ReactWrapper,
propsValidationFn: (props: object) => boolean,
config?: Config
): Promise<void>;
export interface Config {
interval?: number | undefined; // Default: 50, how often to check for validity
timeout?: number | undefined; // Default: 2000 (2 seconds), how long to wait before timing out
timeoutMessage?: string | undefined;
logStructureOnTimeout?: boolean | undefined; // Default: true, logs the wrapper's rendered structure when the wait times out. An attempt to help out in finding what's wrong.
logStructureOnSuccess?: boolean | undefined; // Default: false, logs the wrapper's rendered structure on success.
}
Additional Details
- Last updated: Thu, 08 Jul 2021 12:01:09 GMT
- Dependencies: @types/enzyme
- Global values: none
Credits
These definitions were written by Kim Ehrenpohl.