jest-large-snapshot-warning

0.1.0 • Public • Published

jest-large-snapshot-warning

Add warnings to large snapshots!

Setup

# install
yarn add --dev jest-large-snapshot-warning
// my.test.js
import "jest-large-snapshot-warning";

test("large snapshot", () => {
  expect(/* large object */).toMatchSnapshot();
});

setMaxSnapshotSize

The default max size is 50.

// my.test.js
import { setMaxSnapshotSize } "jest-large-snapshot-warning";

setMaxSnapshotSize(10);

test("large snapshot", () => {
  expect(/* large object */).toMatchSnapshot();
});

setupFiles

To setup a max snapshot size for all test suites, use the setupFiles option in your jest config.

// setupTest.js
import { setMaxSnapshotSize } "jest-large-snapshot-warning";

setMaxSnapshotSize(10);
{
  "setupFiles": ["./setupTest.js"]
}

Readme

Keywords

none

Package Sidebar

Install

npm i jest-large-snapshot-warning

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

2.98 kB

Total Files

7

Last publish

Collaborators

  • jomaxx