Skip to content

Commit 0720339

Browse files
authored
test(html-closing-bracket-newline): make tests more strict (#2832)
1 parent a8c0940 commit 0720339

File tree

1 file changed

+148
-23
lines changed

1 file changed

+148
-23
lines changed

tests/lib/rules/html-closing-bracket-newline.js

Lines changed: 148 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,22 @@ tester.run('html-closing-bracket-newline', rule, {
174174
</template>
175175
`,
176176
errors: [
177-
'Expected no line breaks before closing bracket, but 1 line break found.',
178-
'Expected no line breaks before closing bracket, but 2 line breaks found.'
177+
{
178+
message:
179+
'Expected no line breaks before closing bracket, but 1 line break found.',
180+
line: 3,
181+
column: 15,
182+
endLine: 4,
183+
endColumn: 11
184+
},
185+
{
186+
message:
187+
'Expected no line breaks before closing bracket, but 2 line breaks found.',
188+
line: 4,
189+
column: 17,
190+
endLine: 6,
191+
endColumn: 11
192+
}
179193
]
180194
},
181195
{
@@ -195,7 +209,14 @@ tester.run('html-closing-bracket-newline', rule, {
195209
</template>
196210
`,
197211
errors: [
198-
'Expected 1 line break before closing bracket, but no line breaks found.'
212+
{
213+
message:
214+
'Expected 1 line break before closing bracket, but no line breaks found.',
215+
line: 4,
216+
column: 18,
217+
endLine: 4,
218+
endColumn: 18
219+
}
199220
]
200221
},
201222
{
@@ -219,8 +240,22 @@ tester.run('html-closing-bracket-newline', rule, {
219240
}
220241
],
221242
errors: [
222-
'Expected no line breaks before closing bracket, but 1 line break found.',
223-
'Expected no line breaks before closing bracket, but 2 line breaks found.'
243+
{
244+
message:
245+
'Expected no line breaks before closing bracket, but 1 line break found.',
246+
line: 3,
247+
column: 15,
248+
endLine: 4,
249+
endColumn: 11
250+
},
251+
{
252+
message:
253+
'Expected no line breaks before closing bracket, but 2 line breaks found.',
254+
line: 4,
255+
column: 17,
256+
endLine: 6,
257+
endColumn: 11
258+
}
224259
]
225260
},
226261
{
@@ -246,7 +281,14 @@ tester.run('html-closing-bracket-newline', rule, {
246281
}
247282
],
248283
errors: [
249-
'Expected no line breaks before closing bracket, but 1 line break found.'
284+
{
285+
message:
286+
'Expected no line breaks before closing bracket, but 1 line break found.',
287+
line: 4,
288+
column: 18,
289+
endLine: 5,
290+
endColumn: 13
291+
}
250292
]
251293
},
252294
{
@@ -272,7 +314,14 @@ tester.run('html-closing-bracket-newline', rule, {
272314
}
273315
],
274316
errors: [
275-
'Expected 1 line break before closing bracket, but no line breaks found.'
317+
{
318+
message:
319+
'Expected 1 line break before closing bracket, but no line breaks found.',
320+
line: 4,
321+
column: 18,
322+
endLine: 4,
323+
endColumn: 18
324+
}
276325
]
277326
},
278327
{
@@ -297,8 +346,22 @@ tester.run('html-closing-bracket-newline', rule, {
297346
}
298347
],
299348
errors: [
300-
'Expected no line breaks before closing bracket, but 1 line break found.',
301-
'Expected no line breaks before closing bracket, but 1 line break found.'
349+
{
350+
message:
351+
'Expected no line breaks before closing bracket, but 1 line break found.',
352+
line: 3,
353+
column: 21,
354+
endLine: 4,
355+
endColumn: 11
356+
},
357+
{
358+
message:
359+
'Expected no line breaks before closing bracket, but 1 line break found.',
360+
line: 5,
361+
column: 16,
362+
endLine: 6,
363+
endColumn: 11
364+
}
302365
]
303366
},
304367
{
@@ -329,8 +392,22 @@ tester.run('html-closing-bracket-newline', rule, {
329392
}
330393
],
331394
errors: [
332-
'Expected no line breaks before closing bracket, but 1 line break found.',
333-
'Expected 1 line break before closing bracket, but no line breaks found.'
395+
{
396+
message:
397+
'Expected no line breaks before closing bracket, but 1 line break found.',
398+
line: 5,
399+
column: 18,
400+
endLine: 6,
401+
endColumn: 13
402+
},
403+
{
404+
message:
405+
'Expected 1 line break before closing bracket, but no line breaks found.',
406+
line: 7,
407+
column: 16,
408+
endLine: 7,
409+
endColumn: 16
410+
}
334411
]
335412
},
336413
{
@@ -359,8 +436,22 @@ tester.run('html-closing-bracket-newline', rule, {
359436
}
360437
],
361438
errors: [
362-
'Expected 1 line break before closing bracket, but no line breaks found.',
363-
'Expected 1 line break before closing bracket, but no line breaks found.'
439+
{
440+
message:
441+
'Expected 1 line break before closing bracket, but no line breaks found.',
442+
line: 4,
443+
column: 21,
444+
endLine: 4,
445+
endColumn: 21
446+
},
447+
{
448+
message:
449+
'Expected 1 line break before closing bracket, but no line breaks found.',
450+
line: 5,
451+
column: 16,
452+
endLine: 5,
453+
endColumn: 16
454+
}
364455
]
365456
},
366457
{
@@ -474,42 +565,48 @@ tester.run('html-closing-bracket-newline', rule, {
474565
'Expected 1 line break before closing bracket, but no line breaks found.',
475566
line: 2,
476567
column: 18,
477-
endColumn: 18
568+
endColumn: 18,
569+
endLine: 2
478570
},
479571
{
480572
message:
481573
'Expected 1 line break before closing bracket, but no line breaks found.',
482574
line: 3,
483575
column: 19,
484-
endColumn: 19
576+
endColumn: 19,
577+
endLine: 3
485578
},
486579
{
487580
message:
488581
'Expected 1 line break before closing bracket, but no line breaks found.',
489582
line: 4,
490583
column: 16,
491-
endColumn: 16
584+
endColumn: 16,
585+
endLine: 4
492586
},
493587
{
494588
message:
495589
'Expected 1 line break before closing bracket, but no line breaks found.',
496590
line: 5,
497591
column: 17,
498-
endColumn: 17
592+
endColumn: 17,
593+
endLine: 5
499594
},
500595
{
501596
message:
502597
'Expected 1 line break before closing bracket, but no line breaks found.',
503598
line: 6,
504599
column: 15,
505-
endColumn: 15
600+
endColumn: 15,
601+
endLine: 6
506602
},
507603
{
508604
message:
509605
'Expected 1 line break before closing bracket, but no line breaks found.',
510606
line: 6,
511607
column: 23,
512-
endColumn: 23
608+
endColumn: 23,
609+
endLine: 6
513610
}
514611
]
515612
},
@@ -534,7 +631,14 @@ tester.run('html-closing-bracket-newline', rule, {
534631
}
535632
],
536633
errors: [
537-
'Expected no line breaks before closing bracket, but 1 line break found.'
634+
{
635+
message:
636+
'Expected no line breaks before closing bracket, but 1 line break found.',
637+
line: 3,
638+
column: 18,
639+
endLine: 4,
640+
endColumn: 11
641+
}
538642
]
539643
},
540644
{
@@ -560,7 +664,14 @@ tester.run('html-closing-bracket-newline', rule, {
560664
}
561665
],
562666
errors: [
563-
'Expected 1 line break before closing bracket, but no line breaks found.'
667+
{
668+
message:
669+
'Expected 1 line break before closing bracket, but no line breaks found.',
670+
line: 4,
671+
column: 23,
672+
endLine: 4,
673+
endColumn: 23
674+
}
564675
]
565676
},
566677
{
@@ -584,7 +695,14 @@ tester.run('html-closing-bracket-newline', rule, {
584695
}
585696
],
586697
errors: [
587-
'Expected 1 line break before closing bracket, but no line breaks found.'
698+
{
699+
message:
700+
'Expected 1 line break before closing bracket, but no line breaks found.',
701+
line: 3,
702+
column: 29,
703+
endLine: 3,
704+
endColumn: 29
705+
}
588706
]
589707
},
590708
{
@@ -610,7 +728,14 @@ tester.run('html-closing-bracket-newline', rule, {
610728
}
611729
],
612730
errors: [
613-
'Expected no line breaks before closing bracket, but 1 line break found.'
731+
{
732+
message:
733+
'Expected no line breaks before closing bracket, but 1 line break found.',
734+
line: 4,
735+
column: 23,
736+
endLine: 5,
737+
endColumn: 11
738+
}
614739
]
615740
}
616741
]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy