UNPKG

1.4 kBTypeScriptView Raw
1import * as React from 'react';
2import { ReactWrapper } from 'enzyme';
3import { Component } from 'react';
4import * as ReactTestUtils from 'react-dom/test-utils';
5export declare function findNodes(wrapper: ReactWrapper<any, any>, className: string): ReactWrapper<any, any>;
6export declare function expectNodes(wrapper: ReactWrapper<any, any>, className: string, n: number): void;
7export declare function expectOne(wrapper: ReactWrapper<any, any>, className: string): void;
8export declare function expectMissing(wrapper: ReactWrapper<any, any>, className: string): void;
9/** @deprecated Use fake timers and `jest.runAllTimers()` instead */
10export declare function delay(millisecond: number): Promise<void>;
11/**
12 * Mounts the element attached to a child of document.body. This is primarily for tests involving
13 * event handlers (which don't work right unless the element is attached).
14 */
15export declare function mountAttached<C extends Component, P = C['props'], S = C['state']>(element: React.ReactElement<P>): ReactWrapper<P, S, C>;
16export declare function renderIntoDocument(element: React.ReactElement<any>): HTMLElement;
17export declare function mockEvent(targetValue?: string): ReactTestUtils.SyntheticEventData;
18/**
19 * Hack for forcing Jest to run pending promises
20 * https://github.com/facebook/jest/issues/2157#issuecomment-279171856
21 */
22export declare function flushPromises(): Promise<void>;