Node TAP
    Preparing search index...

    Interface SnapshotOptions

    interface SnapshotOptions {
        cleanSnapshot?: (snapshotData: string) => string;
        compareOptions?: CompareOptions;
        formatSnapshot?: (obj: any) => any;
        snapshotFile?: string;
        snapshotProvider?: new (file: string) => SnapshotProvider;
        writeSnapshot?: boolean;
    }
    Index

    Properties

    cleanSnapshot?: (snapshotData: string) => string

    Function called on the string snapshot result, can be used to remove changeable data, platform-specific stuff, etc.

    compareOptions?: CompareOptions
    formatSnapshot?: (obj: any) => any

    Function used to serialize snapshotted objects to a string. If a non-string is returned, then the default formatting will be used, so this can also transform the object, if needed.

    snapshotFile?: string

    the "file" used to store snapshots. Defaults to a filename based on the test file name and arguments, in ./tap-snapshots. Specifying the same filename will result in getting the same SnapshotProvider.

    snapshotProvider?: new (file: string) => SnapshotProvider

    Class to use to store and load snapshot data. Defaults to SnapshotProviderDefault, which writes to files in ./tap-snapshots There's no hard requirement that "file" be a file on disk of course. Could easily be in a database, localStorage, whatever.

    writeSnapshot?: boolean

    whether or not to write the snapshot file. Defaults true if TAP_SNAPSHOT=1 in the environment.