beater-snapshot
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

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

Package Sidebar

Install

npm i beater-snapshot

Weekly Downloads

2

Version

0.3.0

License

MIT

Unpacked Size

12 kB

Total Files

8

Last publish

Collaborators

  • bouzuya