From 9a187d77728ba111c891b1b2d1a32e7a37422e67 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Thu, 17 Jul 2025 22:22:32 +0200 Subject: [PATCH] test(array-bracket-newline): make tests more strict --- tests/lib/rules/array-bracket-newline.js | 124 ++++++++++++++++++++--- 1 file changed, 110 insertions(+), 14 deletions(-) diff --git a/tests/lib/rules/array-bracket-newline.js b/tests/lib/rules/array-bracket-newline.js index 380f61e4f..0334d2942 100644 --- a/tests/lib/rules/array-bracket-newline.js +++ b/tests/lib/rules/array-bracket-newline.js @@ -40,61 +40,145 @@ tester.run('array-bracket-newline', rule, { { code: '', output: '', - errors: ["There should be no linebreak after '['."] + errors: [ + { + message: "There should be no linebreak after '['.", + line: 1, + column: 23, + endLine: 1, + endColumn: 24 + } + ] }, { code: '', output: '', - errors: ["There should be no linebreak before ']'."] + errors: [ + { + message: "There should be no linebreak before ']'.", + line: 2, + column: 1, + endLine: 2, + endColumn: 2 + } + ] }, { code: '', output: '', errors: [ - "There should be no linebreak after '['.", - "There should be no linebreak before ']'." + { + message: "There should be no linebreak after '['.", + line: 1, + column: 23, + endLine: 1, + endColumn: 24 + }, + { + message: "There should be no linebreak before ']'.", + line: 3, + column: 1, + endLine: 3, + endColumn: 2 + } ] }, { code: '', output: '', options: ['never'], - errors: ["There should be no linebreak after '['."] + errors: [ + { + message: "There should be no linebreak after '['.", + line: 1, + column: 23, + endLine: 1, + endColumn: 24 + } + ] }, { code: '', output: '', options: ['never'], - errors: ["There should be no linebreak before ']'."] + errors: [ + { + message: "There should be no linebreak before ']'.", + line: 2, + column: 1, + endLine: 2, + endColumn: 2 + } + ] }, { code: '', output: '', options: ['never'], errors: [ - "There should be no linebreak after '['.", - "There should be no linebreak before ']'." + { + message: "There should be no linebreak after '['.", + line: 1, + column: 23, + endLine: 1, + endColumn: 24 + }, + { + message: "There should be no linebreak before ']'.", + line: 3, + column: 1, + endLine: 3, + endColumn: 2 + } ] }, { code: '', output: '', options: ['always'], - errors: ["A linebreak is required before ']'."] + errors: [ + { + message: "A linebreak is required before ']'.", + line: 2, + column: 2, + endLine: 2, + endColumn: 3 + } + ] }, { code: '', output: '', options: ['always'], - errors: ["A linebreak is required after '['."] + errors: [ + { + message: "A linebreak is required after '['.", + line: 1, + column: 23, + endLine: 1, + endColumn: 24 + } + ] }, { code: '', output: '', options: ['always'], errors: [ - "A linebreak is required after '['.", - "A linebreak is required before ']'." + { + message: "A linebreak is required after '['.", + line: 1, + column: 23, + endLine: 1, + endColumn: 24 + }, + { + message: "A linebreak is required before ']'.", + line: 1, + column: 25, + endLine: 1, + endColumn: 26 + } ] }, { @@ -102,8 +186,20 @@ tester.run('array-bracket-newline', rule, { output: '', options: ['always'], errors: [ - "A linebreak is required after '['.", - "A linebreak is required before ']'." + { + message: "A linebreak is required after '['.", + line: 1, + column: 27, + endLine: 1, + endColumn: 28 + }, + { + message: "A linebreak is required before ']'.", + line: 1, + column: 29, + endLine: 1, + endColumn: 30 + } ] } ]