1 |
|
2 | import charm from 'charm';
|
3 | import { CoverageMap } from 'istanbul-lib-coverage';
|
4 | import Environment from '../Environment';
|
5 | import Suite from '../Suite';
|
6 | import Test from '../Test';
|
7 | import TextCoverage, { TextCoverageProperties } from './TextCoverage';
|
8 | import { CoverageMessage, DeprecationMessage } from '../executors/Executor';
|
9 | import Node, { TunnelMessage } from '../executors/Node';
|
10 | export default class Pretty extends TextCoverage implements PrettyProperties {
|
11 | colorReplacement: {
|
12 | [key: string]: string;
|
13 | };
|
14 | dimensions: any;
|
15 | titleWidth: number;
|
16 | maxProgressBarWidth: number;
|
17 | tunnelState: string;
|
18 | protected _header: string;
|
19 | protected _log: string[];
|
20 | protected _reports: any;
|
21 | protected _spinnerOffset: number;
|
22 | protected _total: Report;
|
23 | protected _charm: charm.CharmInstance | undefined;
|
24 | protected _renderTimeout: NodeJS.Timer | undefined;
|
25 | constructor(executor: Node, options?: PrettyOptions);
|
26 | close(): void;
|
27 | runStart(): void;
|
28 | runEnd(): void;
|
29 | coverage(data: CoverageMessage): void;
|
30 | suiteStart(suite: Suite): void;
|
31 | suiteEnd(suite: Suite): void;
|
32 | testEnd(test: Test): void;
|
33 | tunnelDownloadProgress(message: TunnelMessage): void;
|
34 | tunnelStatus(message: TunnelMessage): void;
|
35 | error(error: Error): void;
|
36 | deprecated(message: DeprecationMessage): void;
|
37 | private _getReport;
|
38 | private _newCharm;
|
39 | private _record;
|
40 | private _drawProgressBar;
|
41 | private _drawSessionReport;
|
42 | private _abbreviateEnvironment;
|
43 | private _render;
|
44 | private _drawTotalReport;
|
45 | private _getColor;
|
46 | }
|
47 | export interface PrettyProperties extends TextCoverageProperties {
|
48 | colorReplacement: {
|
49 | [key: string]: string;
|
50 | };
|
51 | dimensions: any;
|
52 | maxProgressBarWidth: number;
|
53 | titleWidth: number;
|
54 | }
|
55 | export declare type PrettyOptions = Partial<PrettyProperties>;
|
56 | export declare class Report {
|
57 | environment: Environment | undefined;
|
58 | sessionId: string | undefined;
|
59 | numTotal: number;
|
60 | numPassed: number;
|
61 | numFailed: number;
|
62 | numSkipped: number;
|
63 | results: number[];
|
64 | suiteInfo: {
|
65 | [id: string]: SuiteInfo;
|
66 | };
|
67 | coverageMap: CoverageMap;
|
68 | constructor(environment?: Environment, sessionId?: string);
|
69 | get finished(): number;
|
70 | record(result: Result, count?: number): void;
|
71 | getCompressedResults(maxWidth: number): number[];
|
72 | }
|
73 | export declare enum Result {
|
74 | PASS = 0,
|
75 | SKIP = 1,
|
76 | FAIL = 2
|
77 | }
|
78 | export interface SuiteInfo {
|
79 | parentId: string | undefined;
|
80 | numToReport: number;
|
81 | }
|