From b9b18ba014d185941f2f2c419d9c2f8fd8d0ec52 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Fri, 25 Jul 2025 23:27:27 +0200 Subject: [PATCH] test(multiline-html-element-content-newline): make tests more strict --- .../multiline-html-element-content-newline.js | 270 ++++++++++++++++-- 1 file changed, 240 insertions(+), 30 deletions(-) diff --git a/tests/lib/rules/multiline-html-element-content-newline.js b/tests/lib/rules/multiline-html-element-content-newline.js index 36aa9cfe4..372d277fc 100644 --- a/tests/lib/rules/multiline-html-element-content-newline.js +++ b/tests/lib/rules/multiline-html-element-content-newline.js @@ -384,8 +384,22 @@ multiline `, errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.', - 'Expected 1 line break before closing tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 3, + column: 16, + endLine: 3, + endColumn: 16 + }, + { + message: + 'Expected 1 line break before closing tag (`
`), but no line breaks found.', + line: 4, + column: 20, + endLine: 4, + endColumn: 20 + } ] }, { @@ -401,7 +415,14 @@ multiline content `, errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 3, + column: 16, + endLine: 3, + endColumn: 16 + } ] }, { @@ -417,7 +438,14 @@ multiline content
`, errors: [ - 'Expected 1 line break before closing tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break before closing tag (``), but no line breaks found.', + line: 4, + column: 30, + endLine: 4, + endColumn: 30 + } ] }, // comments @@ -437,8 +465,22 @@ multiline content `, errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.', - 'Expected 1 line break before closing tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 3, + column: 16, + endLine: 3, + endColumn: 16 + }, + { + message: + 'Expected 1 line break before closing tag (`
`), but no line breaks found.', + line: 4, + column: 25, + endLine: 4, + endColumn: 25 + } ] }, { @@ -457,8 +499,22 @@ multiline content `, errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.', - 'Expected 1 line break before closing tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 3, + column: 16, + endLine: 3, + endColumn: 16 + }, + { + message: + 'Expected 1 line break before closing tag (`
`), but no line breaks found.', + line: 4, + column: 23, + endLine: 4, + endColumn: 23 + } ] }, // one error @@ -479,7 +535,14 @@ content `, errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 3, + column: 16, + endLine: 3, + endColumn: 16 + } ] }, { @@ -499,7 +562,14 @@ content `, errors: [ - 'Expected 1 line break before closing tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break before closing tag (`
`), but no line breaks found.', + line: 5, + column: 18, + endLine: 5, + endColumn: 18 + } ] }, // multi @@ -519,12 +589,54 @@ content `, errors: [ - 'Expected 1 line break after opening tag (``), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (``), but no line breaks found.', + line: 3, + column: 35, + endLine: 3, + endColumn: 35 + } ] }, // multi line breaks @@ -548,8 +660,22 @@ content `, errors: [ - 'Expected 1 line break after opening tag (`
`), but 2 line breaks found.', - 'Expected 1 line break before closing tag (`
`), but 2 line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but 2 line breaks found.', + line: 3, + column: 16, + endLine: 5, + endColumn: 13 + }, + { + message: + 'Expected 1 line break before closing tag (`
`), but 2 line breaks found.', + line: 6, + column: 20, + endLine: 8, + endColumn: 11 + } ] }, // allowEmptyLines @@ -575,7 +701,14 @@ content `, options: [{ allowEmptyLines: true, ignoreWhenEmpty: false }], errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 8, + column: 27, + endLine: 8, + endColumn: 27 + } ] }, { @@ -607,8 +740,22 @@ content `, options: [{ allowEmptyLines: true }], errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.', - 'Expected 1 line break before closing tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 9, + column: 16, + endLine: 9, + endColumn: 16 + }, + { + message: + 'Expected 1 line break before closing tag (`
`), but no line breaks found.', + line: 10, + column: 20, + endLine: 10, + endColumn: 20 + } ] }, // mustache @@ -628,8 +775,22 @@ content `, errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.', - 'Expected 1 line break before closing tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 3, + column: 16, + endLine: 3, + endColumn: 16 + }, + { + message: + 'Expected 1 line break before closing tag (`
`), but no line breaks found.', + line: 4, + column: 23, + endLine: 4, + endColumn: 23 + } ] }, // mix @@ -651,8 +812,22 @@ content `, errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.', - 'Expected 1 line break before closing tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 3, + column: 16, + endLine: 3, + endColumn: 16 + }, + { + message: + 'Expected 1 line break before closing tag (`
`), but no line breaks found.', + line: 5, + column: 27, + endLine: 5, + endColumn: 27 + } ] }, // start tag @@ -672,8 +847,22 @@ content `, errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.', - 'Expected 1 line break before closing tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 4, + column: 14, + endLine: 4, + endColumn: 14 + }, + { + message: + 'Expected 1 line break before closing tag (`
`), but no line breaks found.', + line: 4, + column: 21, + endLine: 4, + endColumn: 21 + } ] }, { @@ -692,8 +881,22 @@ content `, errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.', - 'Expected 1 line break before closing tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 4, + column: 18, + endLine: 4, + endColumn: 18 + }, + { + message: + 'Expected 1 line break before closing tag (`
`), but no line breaks found.', + line: 4, + column: 25, + endLine: 4, + endColumn: 25 + } ] }, { @@ -712,7 +915,14 @@ content `, options: [{ ignoreWhenEmpty: false }], errors: [ - 'Expected 1 line break after opening tag (`
`), but no line breaks found.' + { + message: + 'Expected 1 line break after opening tag (`
`), but no line breaks found.', + line: 4, + column: 14, + endLine: 4, + endColumn: 14 + } ] } ]