@@ -31,79 +31,307 @@ ruleTester.run('no-focused-tests', rule, {
31
31
invalid : [
32
32
{
33
33
code : 'describe.only()' ,
34
- errors : [ { messageId : 'focusedTest' , column : 10 , line : 1 } ] ,
34
+ errors : [
35
+ {
36
+ messageId : 'focusedTest' ,
37
+ column : 10 ,
38
+ line : 1 ,
39
+ suggestions : [
40
+ {
41
+ messageId : 'suggestRemoveFocus' ,
42
+ output : 'describe()' ,
43
+ } ,
44
+ ] ,
45
+ } ,
46
+ ] ,
35
47
} ,
36
48
{
37
49
code : 'describe.only.each()' ,
38
- errors : [ { messageId : 'focusedTest' , column : 10 , line : 1 } ] ,
50
+ errors : [
51
+ {
52
+ messageId : 'focusedTest' ,
53
+ column : 10 ,
54
+ line : 1 ,
55
+ suggestions : [
56
+ {
57
+ messageId : 'suggestRemoveFocus' ,
58
+ output : 'describe.each()' ,
59
+ } ,
60
+ ] ,
61
+ } ,
62
+ ] ,
39
63
} ,
40
64
{
41
65
code : 'describe.only.each`table`()' ,
42
- errors : [ { messageId : 'focusedTest' , column : 10 , line : 1 } ] ,
66
+ errors : [
67
+ {
68
+ messageId : 'focusedTest' ,
69
+ column : 10 ,
70
+ line : 1 ,
71
+ suggestions : [
72
+ {
73
+ messageId : 'suggestRemoveFocus' ,
74
+ output : 'describe.each`table`()' ,
75
+ } ,
76
+ ] ,
77
+ } ,
78
+ ] ,
43
79
} ,
44
80
{
45
81
code : 'describe["only"]()' ,
46
- errors : [ { messageId : 'focusedTest' , column : 10 , line : 1 } ] ,
82
+ errors : [
83
+ {
84
+ messageId : 'focusedTest' ,
85
+ column : 10 ,
86
+ line : 1 ,
87
+ suggestions : [
88
+ {
89
+ messageId : 'suggestRemoveFocus' ,
90
+ output : 'describe()' ,
91
+ } ,
92
+ ] ,
93
+ } ,
94
+ ] ,
47
95
} ,
48
96
{
49
97
code : 'it.only()' ,
50
- errors : [ { messageId : 'focusedTest' , column : 4 , line : 1 } ] ,
98
+ errors : [
99
+ {
100
+ messageId : 'focusedTest' ,
101
+ column : 4 ,
102
+ line : 1 ,
103
+ suggestions : [
104
+ {
105
+ messageId : 'suggestRemoveFocus' ,
106
+ output : 'it()' ,
107
+ } ,
108
+ ] ,
109
+ } ,
110
+ ] ,
51
111
} ,
52
112
{
53
113
code : 'it.concurrent.only()' ,
54
- errors : [ { messageId : 'focusedTest' , column : 4 , line : 1 } ] ,
114
+ errors : [
115
+ {
116
+ messageId : 'focusedTest' ,
117
+ column : 4 ,
118
+ line : 1 ,
119
+ suggestions : [
120
+ {
121
+ messageId : 'suggestRemoveFocus' ,
122
+ output : 'it.concurrent()' ,
123
+ } ,
124
+ ] ,
125
+ } ,
126
+ ] ,
55
127
} ,
56
128
{
57
129
code : 'it.only.each()' ,
58
- errors : [ { messageId : 'focusedTest' , column : 4 , line : 1 } ] ,
130
+ errors : [
131
+ {
132
+ messageId : 'focusedTest' ,
133
+ column : 4 ,
134
+ line : 1 ,
135
+ suggestions : [
136
+ {
137
+ messageId : 'suggestRemoveFocus' ,
138
+ output : 'it.each()' ,
139
+ } ,
140
+ ] ,
141
+ } ,
142
+ ] ,
59
143
} ,
60
144
{
61
145
code : 'it.only.each`table`()' ,
62
- errors : [ { messageId : 'focusedTest' , column : 4 , line : 1 } ] ,
146
+ errors : [
147
+ {
148
+ messageId : 'focusedTest' ,
149
+ column : 4 ,
150
+ line : 1 ,
151
+ suggestions : [
152
+ {
153
+ messageId : 'suggestRemoveFocus' ,
154
+ output : 'it.each`table`()' ,
155
+ } ,
156
+ ] ,
157
+ } ,
158
+ ] ,
63
159
} ,
64
160
{
65
161
code : 'it["only"]()' ,
66
- errors : [ { messageId : 'focusedTest' , column : 4 , line : 1 } ] ,
162
+ errors : [
163
+ {
164
+ messageId : 'focusedTest' ,
165
+ column : 4 ,
166
+ line : 1 ,
167
+ suggestions : [
168
+ {
169
+ messageId : 'suggestRemoveFocus' ,
170
+ output : 'it()' ,
171
+ } ,
172
+ ] ,
173
+ } ,
174
+ ] ,
67
175
} ,
68
176
{
69
177
code : 'test.only()' ,
70
- errors : [ { messageId : 'focusedTest' , column : 6 , line : 1 } ] ,
178
+ errors : [
179
+ {
180
+ messageId : 'focusedTest' ,
181
+ column : 6 ,
182
+ line : 1 ,
183
+ suggestions : [
184
+ {
185
+ messageId : 'suggestRemoveFocus' ,
186
+ output : 'test()' ,
187
+ } ,
188
+ ] ,
189
+ } ,
190
+ ] ,
71
191
} ,
72
192
{
73
193
code : 'test.concurrent.only()' ,
74
- errors : [ { messageId : 'focusedTest' , column : 6 , line : 1 } ] ,
194
+ errors : [
195
+ {
196
+ messageId : 'focusedTest' ,
197
+ column : 6 ,
198
+ line : 1 ,
199
+ suggestions : [
200
+ {
201
+ messageId : 'suggestRemoveFocus' ,
202
+ output : 'test.concurrent()' ,
203
+ } ,
204
+ ] ,
205
+ } ,
206
+ ] ,
75
207
} ,
76
208
{
77
209
code : 'test.only.each()' ,
78
- errors : [ { messageId : 'focusedTest' , column : 6 , line : 1 } ] ,
210
+ errors : [
211
+ {
212
+ messageId : 'focusedTest' ,
213
+ column : 6 ,
214
+ line : 1 ,
215
+ suggestions : [
216
+ {
217
+ messageId : 'suggestRemoveFocus' ,
218
+ output : 'test.each()' ,
219
+ } ,
220
+ ] ,
221
+ } ,
222
+ ] ,
79
223
} ,
80
224
{
81
225
code : 'test.only.each`table`()' ,
82
- errors : [ { messageId : 'focusedTest' , column : 6 , line : 1 } ] ,
226
+ errors : [
227
+ {
228
+ messageId : 'focusedTest' ,
229
+ column : 6 ,
230
+ line : 1 ,
231
+ suggestions : [
232
+ {
233
+ messageId : 'suggestRemoveFocus' ,
234
+ output : 'test.each`table`()' ,
235
+ } ,
236
+ ] ,
237
+ } ,
238
+ ] ,
83
239
} ,
84
240
{
85
241
code : 'test["only"]()' ,
86
- errors : [ { messageId : 'focusedTest' , column : 6 , line : 1 } ] ,
242
+ errors : [
243
+ {
244
+ messageId : 'focusedTest' ,
245
+ column : 6 ,
246
+ line : 1 ,
247
+ suggestions : [
248
+ {
249
+ messageId : 'suggestRemoveFocus' ,
250
+ output : 'test()' ,
251
+ } ,
252
+ ] ,
253
+ } ,
254
+ ] ,
87
255
} ,
88
256
{
89
257
code : 'fdescribe()' ,
90
- errors : [ { messageId : 'focusedTest' , column : 1 , line : 1 } ] ,
258
+ errors : [
259
+ {
260
+ messageId : 'focusedTest' ,
261
+ column : 1 ,
262
+ line : 1 ,
263
+ suggestions : [
264
+ {
265
+ messageId : 'suggestRemoveFocus' ,
266
+ output : 'describe()' ,
267
+ } ,
268
+ ] ,
269
+ } ,
270
+ ] ,
91
271
} ,
92
272
{
93
273
code : 'fit()' ,
94
- errors : [ { messageId : 'focusedTest' , column : 1 , line : 1 } ] ,
274
+ errors : [
275
+ {
276
+ messageId : 'focusedTest' ,
277
+ column : 1 ,
278
+ line : 1 ,
279
+ suggestions : [
280
+ {
281
+ messageId : 'suggestRemoveFocus' ,
282
+ output : 'it()' ,
283
+ } ,
284
+ ] ,
285
+ } ,
286
+ ] ,
95
287
} ,
96
288
{
97
289
code : 'fit.each()' ,
98
- errors : [ { messageId : 'focusedTest' , column : 1 , line : 1 } ] ,
290
+ errors : [
291
+ {
292
+ messageId : 'focusedTest' ,
293
+ column : 1 ,
294
+ line : 1 ,
295
+ suggestions : [
296
+ {
297
+ messageId : 'suggestRemoveFocus' ,
298
+ output : 'it.each()' ,
299
+ } ,
300
+ ] ,
301
+ } ,
302
+ ] ,
99
303
} ,
100
304
{
101
305
code : 'fit.each`table`()' ,
102
- errors : [ { messageId : 'focusedTest' , column : 1 , line : 1 } ] ,
306
+ errors : [
307
+ {
308
+ messageId : 'focusedTest' ,
309
+ column : 1 ,
310
+ line : 1 ,
311
+ suggestions : [
312
+ {
313
+ messageId : 'suggestRemoveFocus' ,
314
+ output : 'it.each`table`()' ,
315
+ } ,
316
+ ] ,
317
+ } ,
318
+ ] ,
103
319
} ,
104
320
{
105
321
code : 'ftest.each`table`()' ,
106
- errors : [ { messageId : 'focusedTest' , column : 1 , line : 1 } ] ,
322
+ errors : [
323
+ {
324
+ messageId : 'focusedTest' ,
325
+ column : 1 ,
326
+ line : 1 ,
327
+ suggestions : [
328
+ {
329
+ messageId : 'suggestRemoveFocus' ,
330
+ output : 'test.each`table`()' ,
331
+ } ,
332
+ ] ,
333
+ } ,
334
+ ] ,
107
335
} ,
108
336
] ,
109
337
} ) ;
0 commit comments