utils.d.ts 1.6 KB

12345678910111213141516171819202122232425262728
  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 } from '@jest/types';
  8. import { OptionsReceived as PrettyFormatOptions } from 'pretty-format';
  9. import type { SnapshotData } from './types';
  10. export declare const SNAPSHOT_VERSION = "1";
  11. export declare const SNAPSHOT_GUIDE_LINK = "https://goo.gl/fbAQLP";
  12. export declare const SNAPSHOT_VERSION_WARNING: string;
  13. export declare const testNameToKey: (testName: Config.Path, count: number) => string;
  14. export declare const keyToTestName: (key: string) => string;
  15. export declare const getSnapshotData: (snapshotPath: Config.Path, update: Config.SnapshotUpdateState) => {
  16. data: SnapshotData;
  17. dirty: boolean;
  18. };
  19. export declare const addExtraLineBreaks: (string: string) => string;
  20. export declare const removeExtraLineBreaks: (string: string) => string;
  21. export declare const removeLinesBeforeExternalMatcherTrap: (stack: string) => string;
  22. export declare const serialize: (val: unknown, indent?: number, formatOverrides?: PrettyFormatOptions) => string;
  23. export declare const minify: (val: unknown) => string;
  24. export declare const deserializeString: (stringified: string) => string;
  25. export declare const escapeBacktickString: (str: string) => string;
  26. export declare const ensureDirectoryExists: (filePath: Config.Path) => void;
  27. export declare const saveSnapshotFile: (snapshotData: SnapshotData, snapshotPath: Config.Path) => void;
  28. export declare const deepMerge: (target: any, source: any) => any;