UNPKG

2.56 kBTypeScriptView Raw
1/// <reference types="node" />
2import charm from 'charm';
3import { CoverageMap } from 'istanbul-lib-coverage';
4import Environment from '../Environment';
5import Suite from '../Suite';
6import Test from '../Test';
7import TextCoverage, { TextCoverageProperties } from './TextCoverage';
8import { CoverageMessage, DeprecationMessage } from '../executors/Executor';
9import Node, { TunnelMessage } from '../executors/Node';
10export 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}
47export interface PrettyProperties extends TextCoverageProperties {
48 colorReplacement: {
49 [key: string]: string;
50 };
51 dimensions: any;
52 maxProgressBarWidth: number;
53 titleWidth: number;
54}
55export declare type PrettyOptions = Partial<PrettyProperties>;
56export 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}
73export declare enum Result {
74 PASS = 0,
75 SKIP = 1,
76 FAIL = 2
77}
78export interface SuiteInfo {
79 parentId: string | undefined;
80 numToReport: number;
81}