0.3.0 • Published 4 years ago

beater-snapshot v0.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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/)