utils.d.ts 1.5 KB

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