Variable UnimockConst

Unimock: {
    flush: (() => void);
    get isRecord(): boolean;
    get isReplay(): boolean;
    get mode(): UnimockMode;
    get snapshotDir(): string;
} = ...

Type declaration

  • flush: (() => void)

    Description

    Flushes all dirty snapshot stores to disk.

      • (): void
      • Returns void

  • get isRecord(): boolean

    Description

    Whether current mode is 'record'.

  • get isReplay(): boolean

    Description

    Whether current mode is 'replay'.

  • get mode(): UnimockMode

    Description

    Current operating mode (from UNIMOCK env).

  • get snapshotDir(): string

    Description

    Resolved snapshot directory path.

Description

Convenience namespace bundling the most common Unimock utilities.

Example

import { Unimock } from '@biorate/unimock';

console.log(Unimock.mode); // 'off' | 'record' | 'replay'
Unimock.flush(); // flush all snapshots