SnapshotResolver.d.ts 875 B

123456789101112131415161718
  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. export declare type SnapshotResolver = {
  9. testPathForConsistencyCheck: string;
  10. resolveSnapshotPath(testPath: Config.Path, extension?: string): Config.Path;
  11. resolveTestPath(snapshotPath: Config.Path, extension?: string): Config.Path;
  12. };
  13. export declare const EXTENSION = "snap";
  14. export declare const DOT_EXTENSION: string;
  15. export declare const isSnapshotPath: (path: string) => boolean;
  16. declare type LocalRequire = (module: string) => unknown;
  17. export declare const buildSnapshotResolver: (config: Config.ProjectConfig, localRequire?: Promise<LocalRequire> | LocalRequire) => Promise<SnapshotResolver>;
  18. export {};