Skip to content

Commit e8bd106

Browse files
committed
Add template heading extraction and validation
1 parent 4dcba52 commit e8bd106

File tree

4 files changed

+418
-3
lines changed

4 files changed

+418
-3
lines changed

packages/jest-each/src/__tests__/__snapshots__/template.test.ts.snap

Lines changed: 288 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,42 @@ exports[`jest-each .describe throws an error when called with an empty string 1`
55
"
66
`;
77

8+
exports[`jest-each .describe throws error when there are additional words in first column heading 1`] = `
9+
"Table headings do not conform to expected format:
10+
11+
<green>heading1 | headingN</>
12+
13+
Received:
14+
15+
<red>\\"</>
16+
<red> a is the left | b | expected</>
17+
<red> \\"</>"
18+
`;
19+
20+
exports[`jest-each .describe throws error when there are additional words in last column heading 1`] = `
21+
"Table headings do not conform to expected format:
22+
23+
<green>heading1 | headingN</>
24+
25+
Received:
26+
27+
<red>\\"</>
28+
<red> a | b | expected value</>
29+
<red> \\"</>"
30+
`;
31+
32+
exports[`jest-each .describe throws error when there are additional words in second column heading 1`] = `
33+
"Table headings do not conform to expected format:
34+
35+
<green>heading1 | headingN</>
36+
37+
Received:
38+
39+
<red>\\"</>
40+
<red> a | b is the right | expected</>
41+
<red> \\"</>"
42+
`;
43+
844
exports[`jest-each .describe throws error when there are fewer arguments than headings over multiple rows 1`] = `
945
"Not enough arguments supplied for given headings:
1046
<green>a | b | expected</>
@@ -44,6 +80,42 @@ exports[`jest-each .describe.only throws an error when called with an empty stri
4480
"
4581
`;
4682
83+
exports[`jest-each .describe.only throws error when there are additional words in first column heading 1`] = `
84+
"Table headings do not conform to expected format:
85+
86+
<green>heading1 | headingN</>
87+
88+
Received:
89+
90+
<red>\\"</>
91+
<red> a is the left | b | expected</>
92+
<red> \\"</>"
93+
`;
94+
95+
exports[`jest-each .describe.only throws error when there are additional words in last column heading 1`] = `
96+
"Table headings do not conform to expected format:
97+
98+
<green>heading1 | headingN</>
99+
100+
Received:
101+
102+
<red>\\"</>
103+
<red> a | b | expected value</>
104+
<red> \\"</>"
105+
`;
106+
107+
exports[`jest-each .describe.only throws error when there are additional words in second column heading 1`] = `
108+
"Table headings do not conform to expected format:
109+
110+
<green>heading1 | headingN</>
111+
112+
Received:
113+
114+
<red>\\"</>
115+
<red> a | b is the right | expected</>
116+
<red> \\"</>"
117+
`;
118+
47119
exports[`jest-each .describe.only throws error when there are fewer arguments than headings over multiple rows 1`] = `
48120
"Not enough arguments supplied for given headings:
49121
<green>a | b | expected</>
@@ -83,6 +155,42 @@ exports[`jest-each .fdescribe throws an error when called with an empty string 1
83155
"
84156
`;
85157
158+
exports[`jest-each .fdescribe throws error when there are additional words in first column heading 1`] = `
159+
"Table headings do not conform to expected format:
160+
161+
<green>heading1 | headingN</>
162+
163+
Received:
164+
165+
<red>\\"</>
166+
<red> a is the left | b | expected</>
167+
<red> \\"</>"
168+
`;
169+
170+
exports[`jest-each .fdescribe throws error when there are additional words in last column heading 1`] = `
171+
"Table headings do not conform to expected format:
172+
173+
<green>heading1 | headingN</>
174+
175+
Received:
176+
177+
<red>\\"</>
178+
<red> a | b | expected value</>
179+
<red> \\"</>"
180+
`;
181+
182+
exports[`jest-each .fdescribe throws error when there are additional words in second column heading 1`] = `
183+
"Table headings do not conform to expected format:
184+
185+
<green>heading1 | headingN</>
186+
187+
Received:
188+
189+
<red>\\"</>
190+
<red> a | b is the right | expected</>
191+
<red> \\"</>"
192+
`;
193+
86194
exports[`jest-each .fdescribe throws error when there are fewer arguments than headings over multiple rows 1`] = `
87195
"Not enough arguments supplied for given headings:
88196
<green>a | b | expected</>
@@ -122,6 +230,42 @@ exports[`jest-each .fit throws an error when called with an empty string 1`] = `
122230
"
123231
`;
124232
233+
exports[`jest-each .fit throws error when there are additional words in first column heading 1`] = `
234+
"Table headings do not conform to expected format:
235+
236+
<green>heading1 | headingN</>
237+
238+
Received:
239+
240+
<red>\\"</>
241+
<red> a is the left | b | expected</>
242+
<red> \\"</>"
243+
`;
244+
245+
exports[`jest-each .fit throws error when there are additional words in last column heading 1`] = `
246+
"Table headings do not conform to expected format:
247+
248+
<green>heading1 | headingN</>
249+
250+
Received:
251+
252+
<red>\\"</>
253+
<red> a | b | expected value</>
254+
<red> \\"</>"
255+
`;
256+
257+
exports[`jest-each .fit throws error when there are additional words in second column heading 1`] = `
258+
"Table headings do not conform to expected format:
259+
260+
<green>heading1 | headingN</>
261+
262+
Received:
263+
264+
<red>\\"</>
265+
<red> a | b is the right | expected</>
266+
<red> \\"</>"
267+
`;
268+
125269
exports[`jest-each .fit throws error when there are fewer arguments than headings over multiple rows 1`] = `
126270
"Not enough arguments supplied for given headings:
127271
<green>a | b | expected</>
@@ -161,6 +305,42 @@ exports[`jest-each .it throws an error when called with an empty string 1`] = `
161305
"
162306
`;
163307
308+
exports[`jest-each .it throws error when there are additional words in first column heading 1`] = `
309+
"Table headings do not conform to expected format:
310+
311+
<green>heading1 | headingN</>
312+
313+
Received:
314+
315+
<red>\\"</>
316+
<red> a is the left | b | expected</>
317+
<red> \\"</>"
318+
`;
319+
320+
exports[`jest-each .it throws error when there are additional words in last column heading 1`] = `
321+
"Table headings do not conform to expected format:
322+
323+
<green>heading1 | headingN</>
324+
325+
Received:
326+
327+
<red>\\"</>
328+
<red> a | b | expected value</>
329+
<red> \\"</>"
330+
`;
331+
332+
exports[`jest-each .it throws error when there are additional words in second column heading 1`] = `
333+
"Table headings do not conform to expected format:
334+
335+
<green>heading1 | headingN</>
336+
337+
Received:
338+
339+
<red>\\"</>
340+
<red> a | b is the right | expected</>
341+
<red> \\"</>"
342+
`;
343+
164344
exports[`jest-each .it throws error when there are fewer arguments than headings over multiple rows 1`] = `
165345
"Not enough arguments supplied for given headings:
166346
<green>a | b | expected</>
@@ -200,6 +380,42 @@ exports[`jest-each .it.only throws an error when called with an empty string 1`]
200380
"
201381
`;
202382
383+
exports[`jest-each .it.only throws error when there are additional words in first column heading 1`] = `
384+
"Table headings do not conform to expected format:
385+
386+
<green>heading1 | headingN</>
387+
388+
Received:
389+
390+
<red>\\"</>
391+
<red> a is the left | b | expected</>
392+
<red> \\"</>"
393+
`;
394+
395+
exports[`jest-each .it.only throws error when there are additional words in last column heading 1`] = `
396+
"Table headings do not conform to expected format:
397+
398+
<green>heading1 | headingN</>
399+
400+
Received:
401+
402+
<red>\\"</>
403+
<red> a | b | expected value</>
404+
<red> \\"</>"
405+
`;
406+
407+
exports[`jest-each .it.only throws error when there are additional words in second column heading 1`] = `
408+
"Table headings do not conform to expected format:
409+
410+
<green>heading1 | headingN</>
411+
412+
Received:
413+
414+
<red>\\"</>
415+
<red> a | b is the right | expected</>
416+
<red> \\"</>"
417+
`;
418+
203419
exports[`jest-each .it.only throws error when there are fewer arguments than headings over multiple rows 1`] = `
204420
"Not enough arguments supplied for given headings:
205421
<green>a | b | expected</>
@@ -239,6 +455,42 @@ exports[`jest-each .test throws an error when called with an empty string 1`] =
239455
"
240456
`;
241457
458+
exports[`jest-each .test throws error when there are additional words in first column heading 1`] = `
459+
"Table headings do not conform to expected format:
460+
461+
<green>heading1 | headingN</>
462+
463+
Received:
464+
465+
<red>\\"</>
466+
<red> a is the left | b | expected</>
467+
<red> \\"</>"
468+
`;
469+
470+
exports[`jest-each .test throws error when there are additional words in last column heading 1`] = `
471+
"Table headings do not conform to expected format:
472+
473+
<green>heading1 | headingN</>
474+
475+
Received:
476+
477+
<red>\\"</>
478+
<red> a | b | expected value</>
479+
<red> \\"</>"
480+
`;
481+
482+
exports[`jest-each .test throws error when there are additional words in second column heading 1`] = `
483+
"Table headings do not conform to expected format:
484+
485+
<green>heading1 | headingN</>
486+
487+
Received:
488+
489+
<red>\\"</>
490+
<red> a | b is the right | expected</>
491+
<red> \\"</>"
492+
`;
493+
242494
exports[`jest-each .test throws error when there are fewer arguments than headings over multiple rows 1`] = `
243495
"Not enough arguments supplied for given headings:
244496
<green>a | b | expected</>
@@ -278,6 +530,42 @@ exports[`jest-each .test.only throws an error when called with an empty string 1
278530
"
279531
`;
280532
533+
exports[`jest-each .test.only throws error when there are additional words in first column heading 1`] = `
534+
"Table headings do not conform to expected format:
535+
536+
<green>heading1 | headingN</>
537+
538+
Received:
539+
540+
<red>\\"</>
541+
<red> a is the left | b | expected</>
542+
<red> \\"</>"
543+
`;
544+
545+
exports[`jest-each .test.only throws error when there are additional words in last column heading 1`] = `
546+
"Table headings do not conform to expected format:
547+
548+
<green>heading1 | headingN</>
549+
550+
Received:
551+
552+
<red>\\"</>
553+
<red> a | b | expected value</>
554+
<red> \\"</>"
555+
`;
556+
557+
exports[`jest-each .test.only throws error when there are additional words in second column heading 1`] = `
558+
"Table headings do not conform to expected format:
559+
560+
<green>heading1 | headingN</>
561+
562+
Received:
563+
564+
<red>\\"</>
565+
<red> a | b is the right | expected</>
566+
<red> \\"</>"
567+
`;
568+
281569
exports[`jest-each .test.only throws error when there are fewer arguments than headings over multiple rows 1`] = `
282570
"Not enough arguments supplied for given headings:
283571
<green>a | b | expected</>

0 commit comments

Comments
 (0)