remaxjs / jest-dir-snapshot

Jest matcher for directory snapshot.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jest-dir-snapshot

Jest matcher for directory snapshot.

Usage

Installation

$ npm i --save-dev jest-dir-snapshot

Invocation

  1. Extend Jest's expect
const { toMatchDirSnapshot } = require('jest-dir-snapshot');

expect.extend({ toMatchDirSnapshot });
  1. Use toMatchDirSnapshot() in your tests!
expect({
  'foo.js': 'foo',
}).toMatchDirSnapshot();

API

  • toMatchDirSnapshot takes an optional options object with the following properties:
    • snapshotsDir: A custom absolute path of a directory to keep this snapshot in.
    • snapshotIdentifier: A custom name to give this snapshot. If not provided one is computed automatically.

License

MIT

About

Jest matcher for directory snapshot.

License:MIT License


Languages

Language:TypeScript 96.7%Language:JavaScript 3.3%