Node TAP
    Preparing search index...
    Index

    Constructors

    Properties

    writeSnapshot: boolean = false

    Accessors

    • get cleanSnapshot(): undefined | ((snapshotData: string) => string)

      Method that will be called on snapshot strings. This can be used to remove transient run-specific data from snapshots using simple string transforms.

      Returns undefined | ((snapshotData: string) => string)

    • set cleanSnapshot(clean: undefined | ((snapshotData: string) => string)): void

      Parameters

      • clean: undefined | ((snapshotData: string) => string)

      Returns void

    • get formatSnapshot(): undefined | ((obj: any) => any)

      Function that turns an object into a snapshot string.

      By default tcompare!format is used. If a string is returned, then that string is the snapshot string. If any other type is returned, then the returned value will be formatted using tcompare!format.

      Returns undefined | ((obj: any) => any)

    • set formatSnapshot(format: undefined | ((obj: any) => any)): void

      Parameters

      • format: undefined | ((obj: any) => any)

      Returns void

    • get snapshotFile(): string

      The file where snapshots will be written to and read from

      Returns string

    • set snapshotFile(f: string | URL): void

      Parameters

      • f: string | URL

      Returns void

    Assertion Methods

    • In --snapshot mode, takes a snapshot of the object provided, and writes to the snapshot file.

      Otherwise, reads the snapshot file, and verifies that a snapshot of the object provided matches the stored snapshot.

      Parameters

      Returns boolean

    • Resolve a promise, and verify that the resulting value matches the snapshot.

      Type Parameters

      • T extends unknown = any

      Parameters

      • fnOrPromise: Promise<T> | (() => Promise<T>)
      • ...__namedParameters: MessageExtra

      Returns Promise<boolean>