UNPKG

1.41 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 { Config, TestResult } from '@jest/types';
8import type { Frame } from './types';
9export type { Frame } from './types';
10export declare type StackTraceConfig = Pick<Config.ProjectConfig, 'rootDir' | 'testMatch'>;
11export declare type StackTraceOptions = {
12 noStackTrace: boolean;
13 noCodeFrame?: boolean;
14};
15export declare const formatExecError: (error: Error | TestResult.SerializableError | string | undefined, config: StackTraceConfig, options: StackTraceOptions, testPath?: string | undefined, reuseMessage?: boolean | undefined) => string;
16export declare const getStackTraceLines: (stack: string, options?: StackTraceOptions) => Array<string>;
17export declare const getTopFrame: (lines: Array<string>) => Frame | null;
18export declare const formatStackTrace: (stack: string, config: StackTraceConfig, options: StackTraceOptions, testPath?: string | undefined) => string;
19export declare const formatResultsErrors: (testResults: Array<TestResult.AssertionResult>, config: StackTraceConfig, options: StackTraceOptions, testPath?: string | undefined) => string | null;
20export declare const separateMessageFromStack: (content: string) => {
21 message: string;
22 stack: string;
23};