This package is alpha version. You can use Jest.
A snapshot testing library for beater.
$ npm install --save-dev beater-snapshot
// 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
See: test/helpers.ts