Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test(block-lang): make tests more strict #2804

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 1 commit into from
Jul 18, 2025
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
52 changes: 39 additions & 13 deletions tests/lib/rules/block-lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ tester.run('block-lang', rule, {
{
message: `Only "ts" can be used for the 'lang' attribute of '<script>'.`,
line: 2,
column: 15
column: 15,
endLine: 2,
endColumn: 24
}
]
},
Expand All @@ -56,7 +58,9 @@ tester.run('block-lang', rule, {
{
message: `Only "ts" can be used for the 'lang' attribute of '<script>'.`,
line: 2,
column: 15
column: 15,
endLine: 2,
endColumn: 24
}
]
},
Expand All @@ -68,7 +72,9 @@ tester.run('block-lang', rule, {
{
message: "The 'lang' attribute of '<script>' is missing.",
line: 2,
column: 7
column: 7,
endLine: 2,
endColumn: 15
}
]
},
Expand All @@ -80,7 +86,9 @@ tester.run('block-lang', rule, {
{
message: `Only "ts" can be used for the 'lang' attribute of '<script>'.`,
line: 2,
column: 15
column: 15,
endLine: 2,
endColumn: 22
}
]
},
Expand All @@ -91,7 +99,9 @@ tester.run('block-lang', rule, {
{
message: "Do not specify the 'lang' attribute of '<script>'.",
line: 1,
column: 30
column: 30,
endLine: 1,
endColumn: 39
}
]
},
Expand All @@ -103,7 +113,9 @@ tester.run('block-lang', rule, {
message:
"Do not explicitly specify the default language for the 'lang' attribute of '<script>'.",
line: 1,
column: 30
column: 30,
endLine: 1,
endColumn: 39
}
]
},
Expand All @@ -114,7 +126,9 @@ tester.run('block-lang', rule, {
{
message: "Do not specify the 'lang' attribute of '<script>'.",
line: 1,
column: 30
column: 30,
endLine: 1,
endColumn: 39
}
]
},
Expand All @@ -126,7 +140,9 @@ tester.run('block-lang', rule, {
{
message: "The 'lang' attribute of '<i18n>' is missing.",
line: 1,
column: 1
column: 1,
endLine: 1,
endColumn: 7
}
]
},
Expand All @@ -139,7 +155,9 @@ tester.run('block-lang', rule, {
message:
"Only \"json\" can be used for the 'lang' attribute of '<i18n>'. Or, not specifying the `lang` attribute is allowed.",
line: 2,
column: 13
column: 13,
endLine: 2,
endColumn: 24
}
]
},
Expand All @@ -152,7 +170,9 @@ tester.run('block-lang', rule, {
message:
'Only "json", and "yaml" can be used for the \'lang\' attribute of \'<i18n>\'. Or, not specifying the `lang` attribute is allowed.',
line: 2,
column: 13
column: 13,
endLine: 2,
endColumn: 24
}
]
},
Expand All @@ -165,17 +185,23 @@ tester.run('block-lang', rule, {
{
message: "Do not specify the 'lang' attribute of '<template>'.",
line: 1,
column: 11
column: 11,
endLine: 1,
endColumn: 21
},
{
message: "Do not specify the 'lang' attribute of '<script>'.",
line: 2,
column: 15
column: 15,
endLine: 2,
endColumn: 24
},
{
message: "Do not specify the 'lang' attribute of '<style>'.",
line: 3,
column: 14
column: 14,
endLine: 3,
endColumn: 27
}
]
}
Expand Down