From eba0c4595c126a91f700d5f2e8723ec3f820a830 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Mon, 26 Jul 2021 02:10:08 +0530 Subject: [PATCH] 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 --- tests/lib/rules/unicode-bom.js | 36 ++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/tests/lib/rules/unicode-bom.js b/tests/lib/rules/unicode-bom.js index 0b94a690291..62abee69870 100644 --- a/tests/lib/rules/unicode-bom.js +++ b/tests/lib/rules/unicode-bom.js @@ -41,24 +41,52 @@ ruleTester.run("unicode-bom", rule, { code: "var a = 123;", output: "\uFEFFvar a = 123;", options: ["always"], - errors: [expectedError] + errors: [{ + ...expectedError, + line: 1, + column: 1, + endLine: void 0, + endColumn: void 0 + + }] }, { code: " // here's a comment \nvar a = 123;", output: "\uFEFF // here's a comment \nvar a = 123;", options: ["always"], - errors: [expectedError] + errors: [{ + ...expectedError, + line: 1, + column: 1, + endLine: void 0, + endColumn: void 0 + + }] }, { code: "\uFEFF var a = 123;", output: " var a = 123;", - errors: [unexpectedError] + errors: [{ + ...unexpectedError, + line: 1, + column: 1, + endLine: void 0, + endColumn: void 0 + + }] }, { code: "\uFEFF var a = 123;", output: " var a = 123;", options: ["never"], - errors: [unexpectedError] + errors: [{ + ...unexpectedError, + line: 1, + column: 1, + endLine: void 0, + endColumn: void 0 + + }] } ] });