UNPKG

2.2 kBTypeScriptView Raw
1/**
2 * @module Core
3 */
4export declare enum IEvents {
5 TESTSTARTED = "test:started",
6 TESTCOMPLETED = "test:completed",
7 GROUPSTARTED = "group:started",
8 GROUPCOMPLETED = "group:completed",
9 STARTED = "started",
10 COMPLETED = "completed"
11}
12export declare type IOptions = {
13 bail: boolean;
14 timeout: number;
15 grep?: RegExp;
16};
17export declare type ITestOptions = {
18 timeout: number;
19 regression: boolean;
20 only?: boolean;
21 skip?: boolean;
22 skipInCI?: boolean;
23 runInCI?: boolean;
24};
25export declare enum IGroupStatus {
26 FAILED = "failed",
27 PASSED = "passed",
28 PENDING = "pending"
29}
30export declare enum ITestStatus {
31 FAILED = "failed",
32 PASSED = "passed",
33 SKIPPED = "skipped",
34 TODO = "todo",
35 PENDING = "pending"
36}
37export declare type ITestReport = {
38 title: string;
39 status: ITestStatus;
40 regression: boolean;
41 regressionMessage: string;
42 duration: number;
43 error: Error | null;
44};
45export declare type IGroupReport = {
46 title: string;
47 status: IGroupStatus;
48 error: Error | null;
49};
50export declare type IReport = {
51 regressionCount: number;
52 passedCount: number;
53 skippedCount: number;
54 failedCount: number;
55 total: number;
56 todoCount: number;
57 groups: {
58 title: string;
59 failedTests: {
60 title: string;
61 error: Error;
62 }[];
63 failedHooks: {
64 title: string;
65 error: Error;
66 }[];
67 }[];
68 duration: number;
69};
70export declare type IConfigureOptions = {
71 bail: boolean;
72 timeout: number;
73 files: string[] | string;
74 grep: string | RegExp;
75 experimentalEsmSupport: boolean;
76 before: ((runner: any, emitter: any) => Promise<void>)[];
77 after: ((runner: any, emitter: any) => Promise<void>)[];
78 reporterFn: (emitter: any) => void;
79 filter: (file: string) => void;
80};
81/**
82 * Test callback function. Here `T` is the arguments resolved by
83 * @IResolver
84 */
85export declare type ICallback<T extends any[]> = (...args: T) => Promise<void> | void;
86/**
87 * The resolver to return arguments for the tests and hooks
88 */
89export declare type IResolver<T> = (done: Function, postRun?: Function) => T;