Skip to content

Commit ee3955e

Browse files
authored
test(no-duplicate-attributes): make tests more strict (#2888)
1 parent 8d13b3c commit ee3955e

File tree

1 file changed

+54
-6
lines changed

1 file changed

+54
-6
lines changed

tests/lib/rules/no-duplicate-attributes.js

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,36 +62,84 @@ tester.run('no-duplicate-attributes', rule, {
6262
{
6363
filename: 'test.vue',
6464
code: '<template><div><div foo v-bind:foo></div></div></template>',
65-
errors: ["Duplicate attribute 'foo'."]
65+
errors: [
66+
{
67+
message: "Duplicate attribute 'foo'.",
68+
line: 1,
69+
column: 25,
70+
endLine: 1,
71+
endColumn: 35
72+
}
73+
]
6674
},
6775
{
6876
filename: 'test.vue',
6977
code: '<template><div><div foo :foo></div></div></template>',
70-
errors: ["Duplicate attribute 'foo'."]
78+
errors: [
79+
{
80+
message: "Duplicate attribute 'foo'.",
81+
line: 1,
82+
column: 25,
83+
endLine: 1,
84+
endColumn: 29
85+
}
86+
]
7187
},
7288
{
7389
filename: 'test.vue',
7490
code: '<template><div><div style :style></div></div></template>',
7591
options: [{ allowCoexistStyle: false }],
76-
errors: ["Duplicate attribute 'style'."]
92+
errors: [
93+
{
94+
message: "Duplicate attribute 'style'.",
95+
line: 1,
96+
column: 27,
97+
endLine: 1,
98+
endColumn: 33
99+
}
100+
]
77101
},
78102
{
79103
filename: 'test.vue',
80104
code: '<template><div><div class :class></div></div></template>',
81105
options: [{ allowCoexistClass: false }],
82-
errors: ["Duplicate attribute 'class'."]
106+
errors: [
107+
{
108+
message: "Duplicate attribute 'class'.",
109+
line: 1,
110+
column: 27,
111+
endLine: 1,
112+
endColumn: 33
113+
}
114+
]
83115
},
84116
{
85117
filename: 'test.vue',
86118
code: '<template><div><div :style style></div></div></template>',
87119
options: [{ allowCoexistStyle: false }],
88-
errors: ["Duplicate attribute 'style'."]
120+
errors: [
121+
{
122+
message: "Duplicate attribute 'style'.",
123+
line: 1,
124+
column: 28,
125+
endLine: 1,
126+
endColumn: 33
127+
}
128+
]
89129
},
90130
{
91131
filename: 'test.vue',
92132
code: '<template><div><div :class class></div></div></template>',
93133
options: [{ allowCoexistClass: false }],
94-
errors: ["Duplicate attribute 'class'."]
134+
errors: [
135+
{
136+
message: "Duplicate attribute 'class'.",
137+
line: 1,
138+
column: 28,
139+
endLine: 1,
140+
endColumn: 33
141+
}
142+
]
95143
}
96144
]
97145
})

0 commit comments

Comments
 (0)