Skip to content

remaxjs/jest-dir-snapshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published