index.d.ts 1.4 KB

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