@@ -24,7 +24,13 @@ const asyncFn = async () => {};
24
24
const genFn = function * ( ) { } ;
25
25
const timeout = 5 ;
26
26
const testName = 'Test name' ;
27
- const testTable = [ [ 1 , 2 ] ] ;
27
+
28
+ const list = [ 1 , 2 , 3 ] ;
29
+ const table = [
30
+ [ 1 , 2 ] ,
31
+ [ 3 , 4 ] ,
32
+ ] ;
33
+ const readonlyTable = [ [ 1 , 2 ] , 'one' ] as const ;
28
34
29
35
// https://jestjs.io/docs/api#methods
30
36
expectType < void > ( afterAll ( fn ) ) ;
@@ -84,25 +90,234 @@ expectError(
84
90
expectType < void > ( test ( testName , fn ) ) ;
85
91
expectType < void > ( test ( testName , asyncFn ) ) ;
86
92
expectType < void > ( test ( testName , genFn ) ) ;
87
- expectType < void > ( test . each ( testTable ) ( testName , fn ) ) ;
88
- expectType < void > ( test . each ( testTable ) ( testName , fn , timeout ) ) ;
89
- expectType < void > ( test . only . each ( testTable ) ( testName , fn ) ) ;
90
- expectType < void > ( test . only . each ( testTable ) ( testName , fn , timeout ) ) ;
91
- expectType < void > ( test . skip . each ( testTable ) ( testName , fn ) ) ;
92
- expectType < void > ( test . skip . each ( testTable ) ( testName , fn , timeout ) ) ;
93
- expectType < void > ( test . concurrent . each ( testTable ) ( testName , asyncFn ) ) ;
94
- expectType < void > ( test . concurrent . each ( testTable ) ( testName , asyncFn , timeout ) ) ;
95
- expectType < void > ( test . concurrent . only . each ( testTable ) ( testName , asyncFn ) ) ;
96
- expectType < void > (
97
- test . concurrent . only . each ( testTable ) ( testName , asyncFn , timeout ) ,
98
- ) ;
99
- expectType < void > ( test . concurrent . skip . each ( testTable ) ( testName , asyncFn ) ) ;
100
- expectType < void > (
101
- test . concurrent . skip . each ( testTable ) ( testName , asyncFn , timeout ) ,
102
- ) ;
103
- expectType < void > ( describe . each ( testTable ) ( testName , fn ) ) ;
104
- expectType < void > ( describe . each ( testTable ) ( testName , fn , timeout ) ) ;
105
- expectType < void > ( describe . only . each ( testTable ) ( testName , fn ) ) ;
106
- expectType < void > ( describe . only . each ( testTable ) ( testName , fn , timeout ) ) ;
107
- expectType < void > ( describe . skip . each ( testTable ) ( testName , fn ) ) ;
108
- expectType < void > ( describe . skip . each ( testTable ) ( testName , fn , timeout ) ) ;
93
+
94
+ expectType < void > ( test . each ( list ) ( testName , fn ) ) ;
95
+ expectType < void > ( test . each ( list ) ( testName , fn , timeout ) ) ;
96
+ expectType < void > ( test . each ( table ) ( testName , fn ) ) ;
97
+ expectType < void > ( test . each ( table ) ( testName , fn , timeout ) ) ;
98
+ expectType < void > ( test . each ( readonlyTable ) ( testName , fn ) ) ;
99
+ expectType < void > ( test . each ( readonlyTable ) ( testName , fn , timeout ) ) ;
100
+
101
+ expectType < void > ( test . only . each ( list ) ( testName , fn ) ) ;
102
+ expectType < void > ( test . only . each ( list ) ( testName , fn , timeout ) ) ;
103
+ expectType < void > ( test . only . each ( table ) ( testName , fn ) ) ;
104
+ expectType < void > ( test . only . each ( table ) ( testName , fn , timeout ) ) ;
105
+ expectType < void > ( test . only . each ( readonlyTable ) ( testName , fn ) ) ;
106
+ expectType < void > ( test . only . each ( readonlyTable ) ( testName , fn , timeout ) ) ;
107
+
108
+ expectType < void > ( test . skip . each ( list ) ( testName , fn ) ) ;
109
+ expectType < void > ( test . skip . each ( list ) ( testName , fn , timeout ) ) ;
110
+ expectType < void > ( test . skip . each ( table ) ( testName , fn ) ) ;
111
+ expectType < void > ( test . skip . each ( table ) ( testName , fn , timeout ) ) ;
112
+ expectType < void > ( test . skip . each ( readonlyTable ) ( testName , fn ) ) ;
113
+ expectType < void > ( test . skip . each ( readonlyTable ) ( testName , fn , timeout ) ) ;
114
+
115
+ expectType < void > (
116
+ test . each `
117
+ a | b | expected
118
+ ${ 1 } | ${ 1 } | ${ 2 }
119
+ ${ 1 } | ${ 2 } | ${ 3 }
120
+ ${ 2 } | ${ 1 } | ${ 3 }
121
+ ` ( testName , fn ) ,
122
+ ) ;
123
+
124
+ expectType < void > (
125
+ test . each `
126
+ a | b | expected
127
+ ${ 1 } | ${ 1 } | ${ 2 }
128
+ ${ 1 } | ${ 2 } | ${ 3 }
129
+ ${ 2 } | ${ 1 } | ${ 3 }
130
+ ` ( testName , fn , timeout ) ,
131
+ ) ;
132
+
133
+ expectType < void > (
134
+ test . only . each `
135
+ a | b | expected
136
+ ${ 1 } | ${ 1 } | ${ 2 }
137
+ ${ 1 } | ${ 2 } | ${ 3 }
138
+ ${ 2 } | ${ 1 } | ${ 3 }
139
+ ` ( testName , fn ) ,
140
+ ) ;
141
+
142
+ expectType < void > (
143
+ test . only . each `
144
+ a | b | expected
145
+ ${ 1 } | ${ 1 } | ${ 2 }
146
+ ${ 1 } | ${ 2 } | ${ 3 }
147
+ ${ 2 } | ${ 1 } | ${ 3 }
148
+ ` ( testName , fn , timeout ) ,
149
+ ) ;
150
+
151
+ expectType < void > (
152
+ test . skip . each `
153
+ a | b | expected
154
+ ${ 1 } | ${ 1 } | ${ 2 }
155
+ ${ 1 } | ${ 2 } | ${ 3 }
156
+ ${ 2 } | ${ 1 } | ${ 3 }
157
+ ` ( testName , fn ) ,
158
+ ) ;
159
+
160
+ expectType < void > (
161
+ test . skip . each `
162
+ a | b | expected
163
+ ${ 1 } | ${ 1 } | ${ 2 }
164
+ ${ 1 } | ${ 2 } | ${ 3 }
165
+ ${ 2 } | ${ 1 } | ${ 3 }
166
+ ` ( testName , fn , timeout ) ,
167
+ ) ;
168
+
169
+ expectType < void > ( test . concurrent . each ( list ) ( testName , asyncFn ) ) ;
170
+ expectType < void > ( test . concurrent . each ( list ) ( testName , asyncFn , timeout ) ) ;
171
+ expectType < void > ( test . concurrent . each ( table ) ( testName , asyncFn ) ) ;
172
+ expectType < void > ( test . concurrent . each ( table ) ( testName , asyncFn , timeout ) ) ;
173
+ expectType < void > ( test . concurrent . each ( readonlyTable ) ( testName , asyncFn ) ) ;
174
+ expectType < void > (
175
+ test . concurrent . each ( readonlyTable ) ( testName , asyncFn , timeout ) ,
176
+ ) ;
177
+
178
+ expectType < void > ( test . concurrent . only . each ( list ) ( testName , asyncFn ) ) ;
179
+ expectType < void > ( test . concurrent . only . each ( list ) ( testName , asyncFn , timeout ) ) ;
180
+ expectType < void > ( test . concurrent . only . each ( table ) ( testName , asyncFn ) ) ;
181
+ expectType < void > ( test . concurrent . only . each ( table ) ( testName , asyncFn , timeout ) ) ;
182
+ expectType < void > ( test . concurrent . only . each ( readonlyTable ) ( testName , asyncFn ) ) ;
183
+ expectType < void > (
184
+ test . concurrent . only . each ( readonlyTable ) ( testName , asyncFn , timeout ) ,
185
+ ) ;
186
+
187
+ expectType < void > ( test . concurrent . skip . each ( list ) ( testName , asyncFn ) ) ;
188
+ expectType < void > ( test . concurrent . skip . each ( list ) ( testName , asyncFn , timeout ) ) ;
189
+ expectType < void > ( test . concurrent . skip . each ( table ) ( testName , asyncFn ) ) ;
190
+ expectType < void > ( test . concurrent . skip . each ( table ) ( testName , asyncFn , timeout ) ) ;
191
+ expectType < void > ( test . concurrent . skip . each ( readonlyTable ) ( testName , asyncFn ) ) ;
192
+ expectType < void > (
193
+ test . concurrent . skip . each ( readonlyTable ) ( testName , asyncFn , timeout ) ,
194
+ ) ;
195
+
196
+ expectType < void > (
197
+ test . concurrent . each `
198
+ a | b | expected
199
+ ${ 1 } | ${ 1 } | ${ 2 }
200
+ ${ 1 } | ${ 2 } | ${ 3 }
201
+ ${ 2 } | ${ 1 } | ${ 3 }
202
+ ` ( testName , asyncFn ) ,
203
+ ) ;
204
+
205
+ expectType < void > (
206
+ test . concurrent . each `
207
+ a | b | expected
208
+ ${ 1 } | ${ 1 } | ${ 2 }
209
+ ${ 1 } | ${ 2 } | ${ 3 }
210
+ ${ 2 } | ${ 1 } | ${ 3 }
211
+ ` ( testName , asyncFn , timeout ) ,
212
+ ) ;
213
+
214
+ expectType < void > (
215
+ test . concurrent . only . each `
216
+ a | b | expected
217
+ ${ 1 } | ${ 1 } | ${ 2 }
218
+ ${ 1 } | ${ 2 } | ${ 3 }
219
+ ${ 2 } | ${ 1 } | ${ 3 }
220
+ ` ( testName , asyncFn ) ,
221
+ ) ;
222
+
223
+ expectType < void > (
224
+ test . concurrent . only . each `
225
+ a | b | expected
226
+ ${ 1 } | ${ 1 } | ${ 2 }
227
+ ${ 1 } | ${ 2 } | ${ 3 }
228
+ ${ 2 } | ${ 1 } | ${ 3 }
229
+ ` ( testName , asyncFn , timeout ) ,
230
+ ) ;
231
+
232
+ expectType < void > (
233
+ test . concurrent . skip . each `
234
+ a | b | expected
235
+ ${ 1 } | ${ 1 } | ${ 2 }
236
+ ${ 1 } | ${ 2 } | ${ 3 }
237
+ ${ 2 } | ${ 1 } | ${ 3 }
238
+ ` ( testName , asyncFn ) ,
239
+ ) ;
240
+
241
+ expectType < void > (
242
+ test . concurrent . skip . each `
243
+ a | b | expected
244
+ ${ 1 } | ${ 1 } | ${ 2 }
245
+ ${ 1 } | ${ 2 } | ${ 3 }
246
+ ${ 2 } | ${ 1 } | ${ 3 }
247
+ ` ( testName , asyncFn , timeout ) ,
248
+ ) ;
249
+
250
+ expectType < void > ( describe . each ( list ) ( testName , fn ) ) ;
251
+ expectType < void > ( describe . each ( list ) ( testName , fn , timeout ) ) ;
252
+ expectType < void > ( describe . each ( table ) ( testName , fn ) ) ;
253
+ expectType < void > ( describe . each ( table ) ( testName , fn , timeout ) ) ;
254
+ expectType < void > ( describe . each ( readonlyTable ) ( testName , fn ) ) ;
255
+ expectType < void > ( describe . each ( readonlyTable ) ( testName , fn , timeout ) ) ;
256
+
257
+ expectType < void > ( describe . only . each ( list ) ( testName , fn ) ) ;
258
+ expectType < void > ( describe . only . each ( list ) ( testName , fn , timeout ) ) ;
259
+ expectType < void > ( describe . only . each ( table ) ( testName , fn ) ) ;
260
+ expectType < void > ( describe . only . each ( table ) ( testName , fn , timeout ) ) ;
261
+ expectType < void > ( describe . only . each ( readonlyTable ) ( testName , fn ) ) ;
262
+ expectType < void > ( describe . only . each ( readonlyTable ) ( testName , fn , timeout ) ) ;
263
+
264
+ expectType < void > ( describe . skip . each ( list ) ( testName , fn ) ) ;
265
+ expectType < void > ( describe . skip . each ( list ) ( testName , fn , timeout ) ) ;
266
+ expectType < void > ( describe . skip . each ( table ) ( testName , fn ) ) ;
267
+ expectType < void > ( describe . skip . each ( table ) ( testName , fn , timeout ) ) ;
268
+ expectType < void > ( describe . skip . each ( readonlyTable ) ( testName , fn ) ) ;
269
+ expectType < void > ( describe . skip . each ( readonlyTable ) ( testName , fn , timeout ) ) ;
270
+
271
+ expectType < void > (
272
+ describe . each `
273
+ a | b | expected
274
+ ${ 1 } | ${ 1 } | ${ 2 }
275
+ ${ 1 } | ${ 2 } | ${ 3 }
276
+ ${ 2 } | ${ 1 } | ${ 3 }
277
+ ` ( testName , fn ) ,
278
+ ) ;
279
+
280
+ expectType < void > (
281
+ describe . each `
282
+ a | b | expected
283
+ ${ 1 } | ${ 1 } | ${ 2 }
284
+ ${ 1 } | ${ 2 } | ${ 3 }
285
+ ${ 2 } | ${ 1 } | ${ 3 }
286
+ ` ( testName , fn , timeout ) ,
287
+ ) ;
288
+
289
+ expectType < void > (
290
+ describe . only . each `
291
+ a | b | expected
292
+ ${ 1 } | ${ 1 } | ${ 2 }
293
+ ${ 1 } | ${ 2 } | ${ 3 }
294
+ ${ 2 } | ${ 1 } | ${ 3 }
295
+ ` ( testName , fn ) ,
296
+ ) ;
297
+
298
+ expectType < void > (
299
+ describe . only . each `
300
+ a | b | expected
301
+ ${ 1 } | ${ 1 } | ${ 2 }
302
+ ${ 1 } | ${ 2 } | ${ 3 }
303
+ ${ 2 } | ${ 1 } | ${ 3 }
304
+ ` ( testName , fn , timeout ) ,
305
+ ) ;
306
+
307
+ expectType < void > (
308
+ describe . skip . each `
309
+ a | b | expected
310
+ ${ 1 } | ${ 1 } | ${ 2 }
311
+ ${ 1 } | ${ 2 } | ${ 3 }
312
+ ${ 2 } | ${ 1 } | ${ 3 }
313
+ ` ( testName , fn ) ,
314
+ ) ;
315
+
316
+ expectType < void > (
317
+ describe . skip . each `
318
+ a | b | expected
319
+ ${ 1 } | ${ 1 } | ${ 2 }
320
+ ${ 1 } | ${ 2 } | ${ 3 }
321
+ ${ 2 } | ${ 1 } | ${ 3 }
322
+ ` ( testName , fn , timeout ) ,
323
+ ) ;
0 commit comments