Skip to content

Commit 8267cfa

Browse files
committed
feat(no-large-snapshots-rule): rename threshold option
1 parent 3990217 commit 8267cfa

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docs/rules/no-large-snapshots.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,15 @@ line 4
9797

9898
## Options
9999

100-
This rule has option for modifying the threshold number of lines:
100+
This rule has option for modifying the max number of lines allowed for a
101+
snapshot:
101102

102103
In an `eslintrc` file:
103104

104105
```json
105106
...
106107
"rules": {
107-
"jest/no-large-snapshots": ["warn", { "sizeThreshold": 12 }]
108+
"jest/no-large-snapshots": ["warn", { "maxSize": 12 }]
108109
}
109110
...
110111
```

rules/__tests__/no_large_snapshots.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('no-large-snapshots', () => {
5555
const mockReport = jest.fn();
5656
const mockContext = {
5757
getFilename: () => 'mock-component.jsx.snap',
58-
options: [{ sizeThreshold: 70 }],
58+
options: [{ maxSize: 70 }],
5959
report: mockReport,
6060
};
6161
const mockNode = {

rules/no_large_snapshots.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
module.exports = context => {
44
if (context.getFilename().endsWith('.snap')) {
5-
const lineLimit =
6-
(context.options[0] && context.options[0].sizeThreshold) || 50;
5+
const lineLimit = (context.options[0] && context.options[0].maxSize) || 50;
76

87
return {
98
ExpressionStatement: node => {

0 commit comments

Comments
 (0)