-
Notifications
You must be signed in to change notification settings - Fork 70
/
index.d.ts
35 lines (33 loc) · 1013 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import type { Page } from 'puppeteer'
export interface TestResult {
test: {
data: any,
description: string
},
result: {
delta: number,
deltaPerIteration: number,
numIterations: number,
leaks: any, // TODO: types for this
before: any, // TODO: types for this
after: any // TODO: types for this
}
}
export declare type Scenario<T> = {
setup?: (page: Page) => Promise<void>;
createTests?: (page: Page) => Promise<Array<T>>;
iteration: (page: Page, options: T) => Promise<void>;
teardown?: (page: Page) => Promise<void>;
waitForIdle?: (page: Page) => Promise<void>;
};
export declare type Options = {
debug?: boolean;
heapsnapshot?: boolean;
iterations?: number;
scenario?: Scenario<any>;
signal?: AbortSignal;
progress?: boolean;
};
export declare function findLeaks(url: string, options: Options): AsyncGenerator<TestResult>;
export declare const defaultScenario: Scenario<any>;
export {};