Skip to content

Commit eba0c45

Browse files
authored
Chore: assertions on reporting loc in unicode-bom (refs #12334) (#14809)
* Update: add end location to report in `unicode-bom` * Update: report start location only
1 parent ed945bd commit eba0c45

1 file changed

Lines changed: 32 additions & 4 deletions

File tree

tests/lib/rules/unicode-bom.js

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,52 @@ ruleTester.run("unicode-bom", rule, {
4141
code: "var a = 123;",
4242
output: "\uFEFFvar a = 123;",
4343
options: ["always"],
44-
errors: [expectedError]
44+
errors: [{
45+
...expectedError,
46+
line: 1,
47+
column: 1,
48+
endLine: void 0,
49+
endColumn: void 0
50+
51+
}]
4552
},
4653
{
4754
code: " // here's a comment \nvar a = 123;",
4855
output: "\uFEFF // here's a comment \nvar a = 123;",
4956
options: ["always"],
50-
errors: [expectedError]
57+
errors: [{
58+
...expectedError,
59+
line: 1,
60+
column: 1,
61+
endLine: void 0,
62+
endColumn: void 0
63+
64+
}]
5165
},
5266
{
5367
code: "\uFEFF var a = 123;",
5468
output: " var a = 123;",
55-
errors: [unexpectedError]
69+
errors: [{
70+
...unexpectedError,
71+
line: 1,
72+
column: 1,
73+
endLine: void 0,
74+
endColumn: void 0
75+
76+
}]
5677
},
5778
{
5879
code: "\uFEFF var a = 123;",
5980
output: " var a = 123;",
6081
options: ["never"],
61-
errors: [unexpectedError]
82+
errors: [{
83+
...unexpectedError,
84+
line: 1,
85+
column: 1,
86+
endLine: void 0,
87+
endColumn: void 0
88+
89+
}]
6290
}
6391
]
6492
});

0 commit comments

Comments
 (0)