@@ -28,42 +28,43 @@ ruleTester.run('no-large-snapshots', rule, {
2828 'expect(something).toBe(1)' ,
2929 'expect(something).toMatchInlineSnapshot' ,
3030 {
31- code : generateExpectInlineSnapsCode ( 2 , 'toMatchInlineSnapshot' ) ,
3231 filename : 'mock.js' ,
32+ code : generateExpectInlineSnapsCode ( 2 , 'toMatchInlineSnapshot' ) ,
3333 } ,
3434 {
35+ filename : 'mock.js' ,
3536 code : generateExpectInlineSnapsCode (
3637 2 ,
3738 'toThrowErrorMatchingInlineSnapshot' ,
3839 ) ,
39- filename : 'mock.js' ,
4040 } ,
4141 {
42+ filename : 'mock.jsx' ,
4243 code : generateExpectInlineSnapsCode ( 20 , 'toMatchInlineSnapshot' ) ,
4344 options : [
4445 {
4546 maxSize : 19 ,
4647 inlineMaxSize : 21 ,
4748 } ,
4849 ] ,
49- filename : 'mock.jsx' ,
5050 } ,
5151 {
52+ filename : 'mock.jsx' ,
5253 code : generateExpectInlineSnapsCode ( 60 , 'toMatchInlineSnapshot' ) ,
5354 options : [
5455 {
5556 maxSize : 61 ,
5657 } ,
5758 ] ,
58- filename : 'mock.jsx' ,
5959 } ,
6060 {
6161 // "should not report if node has fewer lines of code than limit"
62- code : generateExportsSnapshotString ( 20 ) ,
6362 filename : '/mock-component.jsx.snap' ,
63+ code : generateExportsSnapshotString ( 20 ) ,
6464 } ,
6565 {
6666 // "it should not report snapshots that are allowed to be large"
67+ filename : '/mock-component.jsx.snap' ,
6768 code : generateExportsSnapshotString ( 58 ) ,
6869 options : [
6970 {
@@ -72,31 +73,31 @@ ruleTester.run('no-large-snapshots', rule, {
7273 } ,
7374 } ,
7475 ] ,
75- filename : '/mock-component.jsx.snap' ,
7676 } ,
7777 {
78+ filename : '/mock-component.jsx.snap' ,
7879 code : generateExportsSnapshotString ( 20 ) ,
7980 options : [
8081 {
8182 maxSize : 21 ,
8283 inlineMaxSize : 19 ,
8384 } ,
8485 ] ,
85- filename : '/mock-component.jsx.snap' ,
8686 } ,
8787 ] ,
8888 invalid : [
8989 {
90+ filename : 'mock.js' ,
9091 code : generateExpectInlineSnapsCode ( 50 , 'toMatchInlineSnapshot' ) ,
9192 errors : [
9293 {
9394 messageId : 'tooLongSnapshots' ,
9495 data : { lineLimit : 50 , lineCount : 51 } ,
9596 } ,
9697 ] ,
97- filename : 'mock.js' ,
9898 } ,
9999 {
100+ filename : 'mock.js' ,
100101 code : generateExpectInlineSnapsCode (
101102 50 ,
102103 'toThrowErrorMatchingInlineSnapshot' ,
@@ -107,9 +108,9 @@ ruleTester.run('no-large-snapshots', rule, {
107108 data : { lineLimit : 50 , lineCount : 51 } ,
108109 } ,
109110 ] ,
110- filename : 'mock.js' ,
111111 } ,
112112 {
113+ filename : 'mock.js' ,
113114 code : generateExpectInlineSnapsCode (
114115 50 ,
115116 'toThrowErrorMatchingInlineSnapshot' ,
@@ -121,32 +122,32 @@ ruleTester.run('no-large-snapshots', rule, {
121122 data : { lineLimit : 50 , lineCount : 51 } ,
122123 } ,
123124 ] ,
124- filename : 'mock.js' ,
125125 } ,
126126 {
127127 // "it should return an empty object for non snapshot files"
128+ filename : 'mock.jsx' ,
128129 code : generateExpectInlineSnapsCode ( 50 , 'toMatchInlineSnapshot' ) ,
129130 errors : [
130131 {
131132 messageId : 'tooLongSnapshots' ,
132133 data : { lineLimit : 50 , lineCount : 51 } ,
133134 } ,
134135 ] ,
135- filename : 'mock.jsx' ,
136136 } ,
137137 {
138138 // "should report if node has more than 50 lines of code, and no sizeThreshold option is passed"
139+ filename : '/mock-component.jsx.snap' ,
139140 code : generateExportsSnapshotString ( 52 ) ,
140141 errors : [
141142 {
142143 messageId : 'tooLongSnapshots' ,
143144 data : { lineLimit : 50 , lineCount : 52 } ,
144145 } ,
145146 ] ,
146- filename : '/mock-component.jsx.snap' ,
147147 } ,
148148 {
149149 // "should report if node has more lines of code than number given in sizeThreshold option"
150+ filename : '/mock-component.jsx.snap' ,
150151 code : generateExportsSnapshotString ( 100 ) ,
151152 options : [ { maxSize : 70 } ] ,
152153 errors : [
@@ -155,9 +156,9 @@ ruleTester.run('no-large-snapshots', rule, {
155156 data : { lineLimit : 70 , lineCount : 100 } ,
156157 } ,
157158 ] ,
158- filename : '/mock-component.jsx.snap' ,
159159 } ,
160160 {
161+ filename : '/mock-component.jsx.snap' ,
161162 code : generateExportsSnapshotString ( 100 ) ,
162163 options : [ { maxSize : 70 , inlineMaxSize : 101 } ] ,
163164 errors : [
@@ -166,10 +167,10 @@ ruleTester.run('no-large-snapshots', rule, {
166167 data : { lineLimit : 70 , lineCount : 100 } ,
167168 } ,
168169 ] ,
169- filename : '/mock-component.jsx.snap' ,
170170 } ,
171171 {
172172 // "should report if maxSize is zero"
173+ filename : '/mock-component.jsx.snap' ,
173174 code : generateExportsSnapshotString ( 1 ) ,
174175 options : [ { maxSize : 0 } ] ,
175176 errors : [
@@ -178,10 +179,10 @@ ruleTester.run('no-large-snapshots', rule, {
178179 data : { lineLimit : 0 , lineCount : 1 } ,
179180 } ,
180181 ] ,
181- filename : '/mock-component.jsx.snap' ,
182182 } ,
183183 {
184184 // "it should report if file is not allowed"
185+ filename : '/mock-component.jsx.snap' ,
185186 code : generateExportsSnapshotString ( 58 ) ,
186187 options : [
187188 {
@@ -196,10 +197,10 @@ ruleTester.run('no-large-snapshots', rule, {
196197 data : { lineLimit : 50 , lineCount : 58 } ,
197198 } ,
198199 ] ,
199- filename : '/mock-component.jsx.snap' ,
200200 } ,
201201 {
202202 // "should not report allowed large snapshots based on regexp"
203+ filename : '/mock-component.jsx.snap' ,
203204 code : [
204205 generateExportsSnapshotString ( 58 , 'a big component w/ text' ) ,
205206 generateExportsSnapshotString ( 58 , 'a big component 2' ) ,
@@ -217,9 +218,9 @@ ruleTester.run('no-large-snapshots', rule, {
217218 data : { lineLimit : 50 , lineCount : 58 } ,
218219 } ,
219220 ] ,
220- filename : '/mock-component.jsx.snap' ,
221221 } ,
222222 {
223+ filename : '/mock-component.jsx.snap' ,
223224 code : [
224225 generateExportsSnapshotString ( 58 , 'a big component w/ text' ) ,
225226 generateExportsSnapshotString ( 58 , 'a big component 2' ) ,
@@ -237,7 +238,6 @@ ruleTester.run('no-large-snapshots', rule, {
237238 data : { lineLimit : 50 , lineCount : 58 } ,
238239 } ,
239240 ] ,
240- filename : '/mock-component.jsx.snap' ,
241241 } ,
242242 ] ,
243243} ) ;
0 commit comments