@@ -158,3 +158,190 @@ const raw_r2 = raw`a\n${"b"}
158158
159159c`;
160160
161+ // Jest's `it.each`:
162+ type Whitespace = " " | "\t" | "\v"
163+ >Whitespace : Symbol(Whitespace, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 41, 3))
164+
165+ type Trim<S extends string, Chars extends string = Whitespace | "\n"> =
166+ >Trim : Symbol(Trim, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 44, 35))
167+ >S : Symbol(S, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 46, 10))
168+ >Chars : Symbol(Chars, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 46, 27))
169+ >Whitespace : Symbol(Whitespace, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 41, 3))
170+
171+ S extends `${Chars}${infer R}` ? Trim<R, Chars> :
172+ >S : Symbol(S, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 46, 10))
173+ >Chars : Symbol(Chars, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 46, 27))
174+ >R : Symbol(R, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 47, 30))
175+ >Trim : Symbol(Trim, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 44, 35))
176+ >R : Symbol(R, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 47, 30))
177+ >Chars : Symbol(Chars, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 46, 27))
178+
179+ S extends `${infer R}${Chars}` ? Trim<R, Chars> :
180+ >S : Symbol(S, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 46, 10))
181+ >R : Symbol(R, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 48, 22))
182+ >Chars : Symbol(Chars, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 46, 27))
183+ >Trim : Symbol(Trim, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 44, 35))
184+ >R : Symbol(R, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 48, 22))
185+ >Chars : Symbol(Chars, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 46, 27))
186+
187+ S;
188+ >S : Symbol(S, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 46, 10))
189+
190+ type Split<S extends string, D extends string> =
191+ >Split : Symbol(Split, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 49, 6))
192+ >S : Symbol(S, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 51, 11))
193+ >D : Symbol(D, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 51, 28))
194+
195+ S extends D ? [] :
196+ >S : Symbol(S, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 51, 11))
197+ >D : Symbol(D, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 51, 28))
198+
199+ S extends `${infer H}${D}${infer T}` ? [H, ...Split<T, D>] :
200+ >S : Symbol(S, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 51, 11))
201+ >H : Symbol(H, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 53, 22))
202+ >D : Symbol(D, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 51, 28))
203+ >T : Symbol(T, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 53, 36))
204+ >H : Symbol(H, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 53, 22))
205+ >Split : Symbol(Split, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 49, 6))
206+ >T : Symbol(T, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 53, 36))
207+ >D : Symbol(D, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 51, 28))
208+
209+ [S];
210+ >S : Symbol(S, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 51, 11))
211+
212+ type ParseRows<A extends any[], S extends readonly string[], Row extends any[] = [], Rows extends any[][] = []> =
213+ >ParseRows : Symbol(ParseRows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 54, 8))
214+ >A : Symbol(A, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 15))
215+ >S : Symbol(S, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 31))
216+ >Row : Symbol(Row, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 60))
217+ >Rows : Symbol(Rows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 84))
218+
219+ [A, S] extends [[infer AH, ...infer AT], readonly [infer TH extends string, ...infer TT extends string[]]] ?
220+ >A : Symbol(A, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 15))
221+ >S : Symbol(S, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 31))
222+ >AH : Symbol(AH, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 26))
223+ >AT : Symbol(AT, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 39))
224+ >TH : Symbol(TH, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 60))
225+ >TT : Symbol(TT, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 88))
226+
227+ Trim<TH, Whitespace> extends "|" ? ParseRows<AT, TT, [...Row, AH], Rows> :
228+ >Trim : Symbol(Trim, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 44, 35))
229+ >TH : Symbol(TH, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 60))
230+ >Whitespace : Symbol(Whitespace, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 41, 3))
231+ >ParseRows : Symbol(ParseRows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 54, 8))
232+ >AT : Symbol(AT, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 39))
233+ >TT : Symbol(TT, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 88))
234+ >Row : Symbol(Row, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 60))
235+ >AH : Symbol(AH, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 26))
236+ >Rows : Symbol(Rows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 84))
237+
238+ Trim<TH, Whitespace> extends "\n" | "" ? ParseRows<AT, TT, [], [...Rows, [...Row, AH]]> :
239+ >Trim : Symbol(Trim, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 44, 35))
240+ >TH : Symbol(TH, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 60))
241+ >Whitespace : Symbol(Whitespace, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 41, 3))
242+ >ParseRows : Symbol(ParseRows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 54, 8))
243+ >AT : Symbol(AT, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 39))
244+ >TT : Symbol(TT, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 88))
245+ >Rows : Symbol(Rows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 84))
246+ >Row : Symbol(Row, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 60))
247+ >AH : Symbol(AH, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 57, 26))
248+
249+ never :
250+ [A, S] extends [[], readonly []] ? Rows :
251+ >A : Symbol(A, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 15))
252+ >S : Symbol(S, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 31))
253+ >Rows : Symbol(Rows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 56, 84))
254+
255+ never;
256+
257+ type JestEachArgument<Headers extends string[], Rows extends any[][]> = {
258+ >JestEachArgument : Symbol(JestEachArgument, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 62, 10))
259+ >Headers : Symbol(Headers, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 64, 22))
260+ >Rows : Symbol(Rows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 64, 47))
261+
262+ [P1 in keyof Rows]: {
263+ >P1 : Symbol(P1, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 65, 5))
264+ >Rows : Symbol(Rows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 64, 47))
265+
266+ [P2 in keyof Headers as P2 extends `${number}` ? Trim<Headers[P2]> : never]:
267+ >P2 : Symbol(P2, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 66, 9))
268+ >Headers : Symbol(Headers, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 64, 22))
269+ >P2 : Symbol(P2, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 66, 9))
270+ >Trim : Symbol(Trim, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 44, 35))
271+ >Headers : Symbol(Headers, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 64, 22))
272+ >P2 : Symbol(P2, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 66, 9))
273+
274+ P2 extends keyof Rows[P1] ? Rows[P1][P2] : undefined;
275+ >P2 : Symbol(P2, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 66, 9))
276+ >Rows : Symbol(Rows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 64, 47))
277+ >P1 : Symbol(P1, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 65, 5))
278+ >Rows : Symbol(Rows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 64, 47))
279+ >P1 : Symbol(P1, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 65, 5))
280+ >P2 : Symbol(P2, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 66, 9))
281+
282+ };
283+ }[number];
284+
285+ type JestEachFunction<Arg> = (name: string, cb: (arg: Arg) => void, timeout?: number) => void;
286+ >JestEachFunction : Symbol(JestEachFunction, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 69, 10))
287+ >Arg : Symbol(Arg, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 71, 22))
288+ >name : Symbol(name, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 71, 30))
289+ >cb : Symbol(cb, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 71, 43))
290+ >arg : Symbol(arg, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 71, 49))
291+ >Arg : Symbol(Arg, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 71, 22))
292+ >timeout : Symbol(timeout, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 71, 67))
293+
294+ type JestEach<T extends readonly string[], A extends any[]> =
295+ >JestEach : Symbol(JestEach, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 71, 94))
296+ >T : Symbol(T, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 73, 14))
297+ >A : Symbol(A, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 73, 42))
298+
299+ T extends readonly [infer TH extends string, ...infer TT extends readonly string[]] ?
300+ >T : Symbol(T, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 73, 14))
301+ >TH : Symbol(TH, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 74, 29))
302+ >TT : Symbol(TT, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 74, 57))
303+
304+ JestEachFunction<JestEachArgument<Split<Trim<TH>, "|">, ParseRows<A, TT>>> :
305+ >JestEachFunction : Symbol(JestEachFunction, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 69, 10))
306+ >JestEachArgument : Symbol(JestEachArgument, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 62, 10))
307+ >Split : Symbol(Split, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 49, 6))
308+ >Trim : Symbol(Trim, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 44, 35))
309+ >TH : Symbol(TH, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 74, 29))
310+ >ParseRows : Symbol(ParseRows, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 54, 8))
311+ >A : Symbol(A, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 73, 42))
312+ >TT : Symbol(TT, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 74, 57))
313+
314+ null;
315+
316+ declare function each<T extends readonly string[], A extends unknown[]>(strs: T, ...args: A): JestEach<T, A>;
317+ >each : Symbol(each, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 76, 13))
318+ >T : Symbol(T, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 78, 22))
319+ >A : Symbol(A, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 78, 50))
320+ >strs : Symbol(strs, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 78, 72))
321+ >T : Symbol(T, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 78, 22))
322+ >args : Symbol(args, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 78, 80))
323+ >A : Symbol(A, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 78, 50))
324+ >JestEach : Symbol(JestEach, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 71, 94))
325+ >T : Symbol(T, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 78, 22))
326+ >A : Symbol(A, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 78, 50))
327+
328+ each`
329+ >each : Symbol(each, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 76, 13))
330+
331+ foo | bar
332+ ${"a"} | ${1}
333+ ${"c"} | ${undefined}
334+ >undefined : Symbol(undefined)
335+
336+ `("test", ({ foo, bar }) => {
337+ >foo : Symbol(foo, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 84, 12))
338+ >bar : Symbol(bar, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 84, 17))
339+
340+ foo;
341+ >foo : Symbol(foo, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 84, 12))
342+
343+ bar;
344+ >bar : Symbol(bar, Decl(taggedTemplateWithSpecificTemplateStrings.ts, 84, 17))
345+
346+ });
347+
0 commit comments