-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
60 lines (60 loc) · 2.17 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import Mocha from 'mocha';
import ora from 'ora';
import color from 'chalk';
interface ProgressReporterOptions {
/** Toggle logs (default: true). */
logs: boolean;
/** Toggle output colors (default: true). */
colors: boolean;
/** Toggle hook reports (default: true). */
hooks: boolean;
}
declare class ProgressReporter {
private events;
/** Sends a progress message to the reporter for the current test. */
progress(message: string): void;
/** Clears the last progress message. */
clear(): void;
/** Logs a message without interrupting the reporter spinners. */
log(message: any, ...additionalMessages: any[]): void;
/** Logs a warning message without interrupting the reporter spinners. */
warn(message: any, ...additionalMessages: any[]): void;
/** Logs an error message without interrupting the reporter spinners. */
error(message: any, ...additionalMessages: any[]): void;
/** Configures the reporter. */
config(options: Partial<ProgressReporterOptions>): void;
}
declare global {
/** The global instance for interacting with the progress reporter. */
const reporter: ProgressReporter;
}
declare const _default: {
new (runner: Mocha.Runner): {
stats: Mocha.Stats;
spinner: ora.Ora;
currentTestMessage: string;
currentProgressMessage: string;
currentLogs: string[];
retries: number;
testInProgress: boolean;
logsRenderedLast: boolean;
hookInProgress: boolean;
config: ProgressReporterOptions;
displayError(error: any): void;
parseHookName(name: string): {
suiteName?: string;
hookType: string;
hookName?: string;
testName: string;
};
getHookMessage(fullTitle: string, begin?: boolean): string;
rerender(): void;
renderFinal(result: 'success' | 'fail' | 'hook-success' | 'hook-fail', message: string): void;
renderLogs(): string;
getTimeTag(duration: number): string;
getDurationColorFunction(duration: number): color.Chalk;
getRetryTag(): string;
getTimeoutTag(error: Error): string;
};
};
export = _default;