Skip to content

test(multiline-html-element-content-newline): make tests more strict #2852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
270 changes: 240 additions & 30 deletions tests/lib/rules/multiline-html-element-content-newline.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,22 @@ multiline
</div>
</template>`,
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 3,
column: 16,
endLine: 3,
endColumn: 16
},
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 4,
column: 20,
endLine: 4,
endColumn: 20
}
]
},
{
Expand All @@ -401,7 +415,14 @@ multiline content
</div>
</template>`,
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 3,
column: 16,
endLine: 3,
endColumn: 16
}
]
},
{
Expand All @@ -417,7 +438,14 @@ multiline content
</div>
</template>`,
errors: [
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.'
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 4,
column: 30,
endLine: 4,
endColumn: 30
}
]
},
// comments
Expand All @@ -437,8 +465,22 @@ multiline content
</template>
`,
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 3,
column: 16,
endLine: 3,
endColumn: 16
},
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 4,
column: 25,
endLine: 4,
endColumn: 25
}
]
},
{
Expand All @@ -457,8 +499,22 @@ multiline content
</template>
`,
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 3,
column: 16,
endLine: 3,
endColumn: 16
},
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 4,
column: 23,
endLine: 4,
endColumn: 23
}
]
},
// one error
Expand All @@ -479,7 +535,14 @@ content
</template>
`,
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 3,
column: 16,
endLine: 3,
endColumn: 16
}
]
},
{
Expand All @@ -499,7 +562,14 @@ content
</template>
`,
errors: [
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.'
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 5,
column: 18,
endLine: 5,
endColumn: 18
}
]
},
// multi
Expand All @@ -519,12 +589,54 @@ content
</template>
`,
errors: [
'Expected 1 line break after opening tag (`<template>`), but no line breaks found.',
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
'Expected 1 line break before closing tag (`</template>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<template>`), but no line breaks found.',
line: 2,
column: 19,
endLine: 2,
endColumn: 19
},
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 2,
column: 24,
endLine: 2,
endColumn: 24
},
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 2,
column: 36,
endLine: 2,
endColumn: 36
},
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 3,
column: 16,
endLine: 3,
endColumn: 16
},
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 3,
column: 29,
endLine: 3,
endColumn: 29
},
{
message:
'Expected 1 line break before closing tag (`</template>`), but no line breaks found.',
line: 3,
column: 35,
endLine: 3,
endColumn: 35
}
]
},
// multi line breaks
Expand All @@ -548,8 +660,22 @@ content
</template>
`,
errors: [
'Expected 1 line break after opening tag (`<div>`), but 2 line breaks found.',
'Expected 1 line break before closing tag (`</div>`), but 2 line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but 2 line breaks found.',
line: 3,
column: 16,
endLine: 5,
endColumn: 13
},
{
message:
'Expected 1 line break before closing tag (`</div>`), but 2 line breaks found.',
line: 6,
column: 20,
endLine: 8,
endColumn: 11
}
]
},
// allowEmptyLines
Expand All @@ -575,7 +701,14 @@ content
</template>`,
options: [{ allowEmptyLines: true, ignoreWhenEmpty: false }],
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 8,
column: 27,
endLine: 8,
endColumn: 27
}
]
},
{
Expand Down Expand Up @@ -607,8 +740,22 @@ content
`,
options: [{ allowEmptyLines: true }],
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 9,
column: 16,
endLine: 9,
endColumn: 16
},
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 10,
column: 20,
endLine: 10,
endColumn: 20
}
]
},
// mustache
Expand All @@ -628,8 +775,22 @@ content
</template>
`,
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 3,
column: 16,
endLine: 3,
endColumn: 16
},
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 4,
column: 23,
endLine: 4,
endColumn: 23
}
]
},
// mix
Expand All @@ -651,8 +812,22 @@ content
</template>
`,
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 3,
column: 16,
endLine: 3,
endColumn: 16
},
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 5,
column: 27,
endLine: 5,
endColumn: 27
}
]
},
// start tag
Expand All @@ -672,8 +847,22 @@ content
</template>
`,
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 4,
column: 14,
endLine: 4,
endColumn: 14
},
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 4,
column: 21,
endLine: 4,
endColumn: 21
}
]
},
{
Expand All @@ -692,8 +881,22 @@ content
</template>
`,
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 4,
column: 18,
endLine: 4,
endColumn: 18
},
{
message:
'Expected 1 line break before closing tag (`</div>`), but no line breaks found.',
line: 4,
column: 25,
endLine: 4,
endColumn: 25
}
]
},
{
Expand All @@ -712,7 +915,14 @@ content
`,
options: [{ ignoreWhenEmpty: false }],
errors: [
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.'
{
message:
'Expected 1 line break after opening tag (`<div>`), but no line breaks found.',
line: 4,
column: 14,
endLine: 4,
endColumn: 14
}
]
}
]
Expand Down
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