Skip to content

Commit 1bd95d3

Browse files
authored
test(mustache-interpolation-spacing): make tests more strict (#2854)
1 parent 1243d23 commit 1bd95d3

File tree

1 file changed

+78
-10
lines changed

1 file changed

+78
-10
lines changed

tests/lib/rules/mustache-interpolation-spacing.js

Lines changed: 78 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,37 +80,81 @@ ruleTester.run('mustache-interpolation-spacing', rule, {
8080
code: '<template><div>{{ text}}</div></template>',
8181
output: '<template><div>{{ text }}</div></template>',
8282
options: ['always'],
83-
errors: ["Expected 1 space before '}}', but not found."]
83+
errors: [
84+
{
85+
message: "Expected 1 space before '}}', but not found.",
86+
line: 1,
87+
column: 23,
88+
endLine: 1,
89+
endColumn: 25
90+
}
91+
]
8492
},
8593
{
8694
filename: 'test.vue',
8795
code: '<template><div>{{text }}</div></template>',
8896
output: '<template><div>{{ text }}</div></template>',
8997
options: ['always'],
90-
errors: ["Expected 1 space after '{{', but not found."]
98+
errors: [
99+
{
100+
message: "Expected 1 space after '{{', but not found.",
101+
line: 1,
102+
column: 16,
103+
endLine: 1,
104+
endColumn: 18
105+
}
106+
]
91107
},
92108
{
93109
filename: 'test.vue',
94110
code: '<template><div>{{ text}}</div></template>',
95111
output: '<template><div>{{text}}</div></template>',
96112
options: ['never'],
97-
errors: ["Expected no space after '{{', but found."]
113+
errors: [
114+
{
115+
message: "Expected no space after '{{', but found.",
116+
line: 1,
117+
column: 16,
118+
endLine: 1,
119+
endColumn: 19
120+
}
121+
]
98122
},
99123
{
100124
filename: 'test.vue',
101125
code: '<template><div>{{text }}</div></template>',
102126
output: '<template><div>{{text}}</div></template>',
103127
options: ['never'],
104-
errors: ["Expected no space before '}}', but found."]
128+
errors: [
129+
{
130+
message: "Expected no space before '}}', but found.",
131+
line: 1,
132+
column: 22,
133+
endLine: 1,
134+
endColumn: 25
135+
}
136+
]
105137
},
106138
{
107139
filename: 'test.vue',
108140
code: '<template><div>{{text}}</div></template>',
109141
output: '<template><div>{{ text }}</div></template>',
110142
options: ['always'],
111143
errors: [
112-
"Expected 1 space after '{{', but not found.",
113-
"Expected 1 space before '}}', but not found."
144+
{
145+
message: "Expected 1 space after '{{', but not found.",
146+
line: 1,
147+
column: 16,
148+
endLine: 1,
149+
endColumn: 18
150+
},
151+
{
152+
message: "Expected 1 space before '}}', but not found.",
153+
line: 1,
154+
column: 22,
155+
endLine: 1,
156+
endColumn: 24
157+
}
114158
]
115159
},
116160
{
@@ -119,8 +163,20 @@ ruleTester.run('mustache-interpolation-spacing', rule, {
119163
output: '<template><div>{{text}}</div></template>',
120164
options: ['never'],
121165
errors: [
122-
"Expected no space after '{{', but found.",
123-
"Expected no space before '}}', but found."
166+
{
167+
message: "Expected no space after '{{', but found.",
168+
line: 1,
169+
column: 16,
170+
endLine: 1,
171+
endColumn: 19
172+
},
173+
{
174+
message: "Expected no space before '}}', but found.",
175+
line: 1,
176+
column: 23,
177+
endLine: 1,
178+
endColumn: 26
179+
}
124180
]
125181
},
126182
{
@@ -129,8 +185,20 @@ ruleTester.run('mustache-interpolation-spacing', rule, {
129185
output: '<template><div>{{text}}</div></template>',
130186
options: ['never'],
131187
errors: [
132-
"Expected no space after '{{', but found.",
133-
"Expected no space before '}}', but found."
188+
{
189+
message: "Expected no space after '{{', but found.",
190+
line: 1,
191+
column: 16,
192+
endLine: 1,
193+
endColumn: 21
194+
},
195+
{
196+
message: "Expected no space before '}}', but found.",
197+
line: 1,
198+
column: 25,
199+
endLine: 1,
200+
endColumn: 30
201+
}
134202
]
135203
}
136204
]

0 commit comments

Comments
 (0)