UNPKG

1.46 kBTypeScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7import type { AggregatedResult, TestCaseResult, TestResult } from '@jest/test-result';
8import type { Config } from '@jest/types';
9import type { ReporterOnStartOptions, Test } from './types';
10declare type Cache = {
11 content: string;
12 clear: string;
13};
14/**
15 * A class that generates the CLI status of currently running tests
16 * and also provides an ANSI escape sequence to remove status lines
17 * from the terminal.
18 */
19export default class Status {
20 private _cache;
21 private _callback?;
22 private _currentTests;
23 private _currentTestCases;
24 private _done;
25 private _emitScheduled;
26 private _estimatedTime;
27 private _interval?;
28 private _aggregatedResults?;
29 private _showStatus;
30 constructor();
31 onChange(callback: () => void): void;
32 runStarted(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions): void;
33 runFinished(): void;
34 addTestCaseResult(test: Test, testCaseResult: TestCaseResult): void;
35 testStarted(testPath: Config.Path, config: Config.ProjectConfig): void;
36 testFinished(_config: Config.ProjectConfig, testResult: TestResult, aggregatedResults: AggregatedResult): void;
37 get(): Cache;
38 private _emit;
39 private _debouncedEmit;
40 private _tick;
41}
42export {};