Skip to content
A snapshot testing library for beater.
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__snapshots__
src
test
.gitignore
.travis.yml
LICENSE
README.md
package-lock.json
package.json
tsconfig.json

README.md

beater-snapshot

This package is alpha version. You can use Jest.

A snapshot testing library for beater.

Installation

$ npm install --save-dev beater-snapshot

Usage

// test.js
const { init } = require('beater-snapshot');

const matchSnapshot = init(); // options
const actual = { your: 'test target' };
matchSnapshot('snapshot file name', actual);

console.log('OK');
$ node test.js                          # Error: no snapshot
$ UPDATE_SNAPSHOT=true node test.js     # update snapshot
OK
$ ls __snapshots__/
snapshot_file_name.json                 # snapshot files
$ cat __snapshots__/snapshot_file_name.json
{
  "your": "test target"
}
$ node test.js                          # Success
OK

Options

See: test/helpers.ts

Badges

npm version Travis CI

License

MIT

Author

bouzuya <m@bouzuya.net> (https://bouzuya.net/)

You can’t perform that action at this time.