1.0.0 • Published 5 years ago
jest-dir-snapshot v1.0.0
jest-dir-snapshot
Jest matcher for directory snapshot.
Usage
Installation
$ npm i --save-dev jest-dir-snapshotInvocation
- Extend Jest's expect
const { toMatchDirSnapshot } = require('jest-dir-snapshot');
expect.extend({ toMatchDirSnapshot });- Use
toMatchDirSnapshot()in your tests!
expect({
'foo.js': 'foo',
}).toMatchDirSnapshot();API
toMatchDirSnapshottakes 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.