UNPKG

2.01 kBTypeScriptView Raw
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 */
7import type { Config } from '@jest/types';
8import type { FS as HasteFS } from 'jest-haste-map';
9import { SnapshotResolver as JestSnapshotResolver } from './SnapshotResolver';
10import SnapshotState from './State';
11import type { Context, ExpectationResult } from './types';
12import * as utils from './utils';
13declare 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};
30declare namespace JestSnapshot {
31 type SnapshotResolver = JestSnapshotResolver;
32 type SnapshotStateType = SnapshotState;
33}
34export = JestSnapshot;