https://github.com/jomaxx/jest-large-snapshot-warning
  
  
    Add warnings to large snapshots! 
    https://github.com/jomaxx/jest-large-snapshot-warning
  
        Last synced: 6 months ago 
        JSON representation
    
Add warnings to large snapshots!
- Host: GitHub
 - URL: https://github.com/jomaxx/jest-large-snapshot-warning
 - Owner: jomaxx
 - Created: 2019-06-15T01:33:55.000Z (over 6 years ago)
 - Default Branch: master
 - Last Pushed: 2023-01-04T00:41:23.000Z (almost 3 years ago)
 - Last Synced: 2025-05-01T19:49:23.463Z (6 months ago)
 - Language: JavaScript
 - Homepage: https://www.npmjs.com/package/jest-large-snapshot-warning
 - Size: 854 KB
 - Stars: 2
 - Watchers: 0
 - Forks: 1
 - Open Issues: 13
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
- awesome-jest - jest-large-snapshot-warning
 
README
          # jest-large-snapshot-warning
Add warnings to large snapshots!
## Setup
```bash
# install
yarn add --dev jest-large-snapshot-warning
```
```js
// my.test.js
import "jest-large-snapshot-warning";
test("large snapshot", () => {
  expect(/* large object */).toMatchSnapshot();
});
```
### setMaxSnapshotSize
The default max size is `50`.
```js
// 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](https://jestjs.io/docs/en/configuration.html#setupfiles-array) option in your jest config.
```js
// setupTest.js
import { setMaxSnapshotSize } "jest-large-snapshot-warning";
setMaxSnapshotSize(10);
```
```json
{
  "setupFiles": ["./setupTest.js"]
}
```