index.d.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334
  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 { FS as HasteFS } from 'jest-haste-map';
  9. import { SnapshotResolver as JestSnapshotResolver } from './SnapshotResolver';
  10. import SnapshotState from './State';
  11. import type { Context, ExpectationResult } from './types';
  12. import * as utils from './utils';
  13. declare const JestSnapshot: {
  14. EXTENSION: string;
  15. SnapshotState: typeof SnapshotState;
  16. addSerializer: (plugin: import("pretty-format").Plugin) => void;
  17. buildSnapshotResolver: (config: Config.ProjectConfig, localRequire?: ((module: string) => unknown) | Promise<(module: string) => unknown>) => Promise<JestSnapshotResolver>;
  18. cleanup: (hasteFS: HasteFS, update: Config.SnapshotUpdateState, snapshotResolver: JestSnapshotResolver, testPathIgnorePatterns?: string[] | undefined) => {
  19. filesRemoved: number;
  20. filesRemovedList: Array<string>;
  21. };
  22. getSerializers: () => import("pretty-format").Plugins;
  23. isSnapshotPath: (path: string) => boolean;
  24. toMatchInlineSnapshot: (this: Context, received: unknown, propertiesOrSnapshot?: string | object | undefined, inlineSnapshot?: string | undefined) => ExpectationResult;
  25. toMatchSnapshot: (this: Context, received: unknown, propertiesOrHint?: string | object | undefined, hint?: string | undefined) => ExpectationResult;
  26. toThrowErrorMatchingInlineSnapshot: (this: Context, received: unknown, inlineSnapshot?: string | undefined, fromPromise?: boolean | undefined) => ExpectationResult;
  27. toThrowErrorMatchingSnapshot: (this: Context, received: unknown, hint: string | undefined, fromPromise: boolean) => ExpectationResult;
  28. utils: typeof utils;
  29. };
  30. declare namespace JestSnapshot {
  31. type SnapshotResolver = JestSnapshotResolver;
  32. type SnapshotStateType = SnapshotState;
  33. }
  34. export = JestSnapshot;