1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type {Config} from '@jest/types';
|
8 | import type {StackData} from 'stack-utils';
|
9 | import type {TestResult} from '@jest/types';
|
10 |
|
11 | export declare const formatExecError: (
|
12 | error: Error | TestResult.SerializableError | string | number | undefined,
|
13 | config: StackTraceConfig,
|
14 | options: StackTraceOptions,
|
15 | testPath?: string,
|
16 | reuseMessage?: boolean,
|
17 | noTitle?: boolean,
|
18 | ) => string;
|
19 |
|
20 | export declare const formatPath: (
|
21 | line: string,
|
22 | config: StackTraceConfig,
|
23 | relativeTestPath?: string | null,
|
24 | ) => string;
|
25 |
|
26 | export declare const formatResultsErrors: (
|
27 | testResults: Array<TestResult.AssertionResult>,
|
28 | config: StackTraceConfig,
|
29 | options: StackTraceOptions,
|
30 | testPath?: string,
|
31 | ) => string | null;
|
32 |
|
33 | export declare const formatStackTrace: (
|
34 | stack: string,
|
35 | config: StackTraceConfig,
|
36 | options: StackTraceOptions,
|
37 | testPath?: string,
|
38 | ) => string;
|
39 |
|
40 | export declare interface Frame extends StackData {
|
41 | file: string;
|
42 | }
|
43 |
|
44 | export declare const getStackTraceLines: (
|
45 | stack: string,
|
46 | options?: StackTraceOptions,
|
47 | ) => Array<string>;
|
48 |
|
49 | export declare const getTopFrame: (lines: Array<string>) => Frame | null;
|
50 |
|
51 | export declare const indentAllLines: (lines: string) => string;
|
52 |
|
53 | export declare const separateMessageFromStack: (content: string) => {
|
54 | message: string;
|
55 | stack: string;
|
56 | };
|
57 |
|
58 | export declare type StackTraceConfig = Pick<
|
59 | Config.ProjectConfig,
|
60 | 'rootDir' | 'testMatch'
|
61 | >;
|
62 |
|
63 | export declare type StackTraceOptions = {
|
64 | noStackTrace: boolean;
|
65 | noCodeFrame?: boolean;
|
66 | };
|
67 |
|
68 | export {};
|