From 8c221c296cbe958960a02d2a5d43e4235a9476c9 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Thu, 31 Jul 2025 21:00:18 +0200 Subject: [PATCH] test(no-duplicate-attr-inheritance): make tests more strict --- .../rules/no-duplicate-attr-inheritance.js | 90 ++++++++++++++++--- 1 file changed, 80 insertions(+), 10 deletions(-) diff --git a/tests/lib/rules/no-duplicate-attr-inheritance.js b/tests/lib/rules/no-duplicate-attr-inheritance.js index 41e9f1522..8a007b491 100644 --- a/tests/lib/rules/no-duplicate-attr-inheritance.js +++ b/tests/lib/rules/no-duplicate-attr-inheritance.js @@ -157,7 +157,15 @@ ruleTester.run('no-duplicate-attr-inheritance', rule, { { filename: 'test.vue', code: '', - errors: ['Set "inheritAttrs" to false.'] + errors: [ + { + message: 'Set "inheritAttrs" to false.', + line: 1, + column: 29, + endLine: 1, + endColumn: 35 + } + ] }, { filename: 'test.vue', @@ -169,7 +177,15 @@ ruleTester.run('no-duplicate-attr-inheritance', rule, { } `, - errors: ['Set "inheritAttrs" to false.'] + errors: [ + { + message: 'Set "inheritAttrs" to false.', + line: 2, + column: 37, + endLine: 2, + endColumn: 43 + } + ] }, { filename: 'test.vue', @@ -184,7 +200,10 @@ ruleTester.run('no-duplicate-attr-inheritance', rule, { errors: [ { message: 'Set "inheritAttrs" to false.', - line: 7 + line: 7, + column: 30, + endLine: 7, + endColumn: 36 } ] }, @@ -199,7 +218,10 @@ ruleTester.run('no-duplicate-attr-inheritance', rule, { errors: [ { message: 'Set "inheritAttrs" to false.', - line: 5 + line: 5, + column: 30, + endLine: 5, + endColumn: 36 } ] }, @@ -207,7 +229,15 @@ ruleTester.run('no-duplicate-attr-inheritance', rule, { filename: 'test.vue', code: ``, options: [{ checkMultiRootNodes: true }], - errors: [{ message: 'Set "inheritAttrs" to false.' }] + errors: [ + { + message: 'Set "inheritAttrs" to false.', + line: 1, + column: 24, + endLine: 1, + endColumn: 30 + } + ] }, { filename: 'test.vue', @@ -219,7 +249,15 @@ ruleTester.run('no-duplicate-attr-inheritance', rule, { `, options: [{ checkMultiRootNodes: true }], - errors: [{ message: 'Set "inheritAttrs" to false.' }] + errors: [ + { + message: 'Set "inheritAttrs" to false.', + line: 3, + column: 40, + endLine: 3, + endColumn: 46 + } + ] }, // condition group as a single root node { @@ -231,7 +269,15 @@ ruleTester.run('no-duplicate-attr-inheritance', rule, {
`, - errors: [{ message: 'Set "inheritAttrs" to false.' }] + errors: [ + { + message: 'Set "inheritAttrs" to false.', + line: 3, + column: 40, + endLine: 3, + endColumn: 46 + } + ] }, { filename: 'test.vue', @@ -243,7 +289,15 @@ ruleTester.run('no-duplicate-attr-inheritance', rule, {
`, - errors: [{ message: 'Set "inheritAttrs" to false.' }] + errors: [ + { + message: 'Set "inheritAttrs" to false.', + line: 3, + column: 40, + endLine: 3, + endColumn: 46 + } + ] }, { filename: 'test.vue', @@ -253,7 +307,15 @@ ruleTester.run('no-duplicate-attr-inheritance', rule, {
`, - errors: [{ message: 'Set "inheritAttrs" to false.' }] + errors: [ + { + message: 'Set "inheritAttrs" to false.', + line: 3, + column: 40, + endLine: 3, + endColumn: 46 + } + ] }, { filename: 'test.vue', @@ -262,7 +324,15 @@ ruleTester.run('no-duplicate-attr-inheritance', rule, {
`, - errors: [{ message: 'Set "inheritAttrs" to false.' }] + errors: [ + { + message: 'Set "inheritAttrs" to false.', + line: 3, + column: 40, + endLine: 3, + endColumn: 46 + } + ] } ] })