Skip to content

Commit 50c1ea0

Browse files
committed
Update formating for tests
1 parent fe4a932 commit 50c1ea0

File tree

1 file changed

+82
-64
lines changed

1 file changed

+82
-64
lines changed

tests/lib/utils/vue-component.js

Lines changed: 82 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,12 @@ function invalidTests (ext) {
105105
{
106106
filename: `test.${ext}`,
107107
code: `
108-
Vue.component('async-example', function (resolve, reject) {
109-
// @vue/component
110-
resolve({})
111-
})
112-
// ${ext}`,
108+
Vue.component('async-example', function (resolve, reject) {
109+
// @vue/component
110+
resolve({})
111+
})
112+
// ${ext}
113+
`,
113114
parserOptions,
114115
errors: [makeError(4)]
115116
},
@@ -122,108 +123,125 @@ function invalidTests (ext) {
122123
{
123124
filename: `test.${ext}`,
124125
code: `
125-
// @vue/component
126-
export default { }
127-
// ${ext}`,
126+
// @vue/component
127+
export default { }
128+
// ${ext}
129+
`,
128130
parserOptions,
129131
errors: [makeError(3)]
130132
},
131133
{
132134
filename: `test.${ext}`,
133135
code: `
134-
/* @vue/component */
135-
export default { }
136-
// ${ext}`,
136+
/* @vue/component */
137+
export default { }
138+
// ${ext}
139+
`,
137140
parserOptions,
138141
errors: [makeError(3)]
139142
},
140143
{
141144
filename: `test.${ext}`,
142145
code: `
143-
/*
144-
* ext: ${ext}
145-
* @vue/component
146-
*/
147-
export default { }
148-
// ${ext}`,
146+
/*
147+
* ext: ${ext}
148+
* @vue/component
149+
*/
150+
export default { }
151+
// ${ext}
152+
`,
149153
parserOptions,
150154
errors: [makeError(6)]
151155
},
152156
{
153157
filename: `test.${ext}`,
154-
code: `// @vue/component
155-
export default { }
156-
// @vue/component
157-
export var a = { }
158-
// ${ext}`,
158+
code: `
159+
// @vue/component
160+
export default { }
161+
// @vue/component
162+
export var a = { }
163+
// ${ext}
164+
`,
159165
parserOptions,
160-
errors: [makeError(2), makeError(4)]
166+
errors: [makeError(3), makeError(5)]
161167
},
162168
{
163169
filename: `test.${ext}`,
164-
code: `/* @vue/component */
165-
export const foo = { }
166-
/* @vue/component */
167-
export default { }
168-
// ${ext}`,
170+
code: `
171+
/* @vue/component */
172+
export const foo = { }
173+
/* @vue/component */
174+
export default { }
175+
// ${ext}
176+
`,
169177
parserOptions,
170-
errors: [makeError(2), makeError(4)]
178+
errors: [makeError(3), makeError(5)]
171179
},
172180
{
173181
filename: `test.${ext}`,
174-
code: `export default { }
175-
// @vue/component
176-
export let foo = { }
177-
// ${ext}`,
182+
code: `
183+
export default { }
184+
// @vue/component
185+
export let foo = { }
186+
// ${ext}
187+
`,
178188
parserOptions,
179-
errors: (ext === 'js' ? [] : [makeError(1)]).concat([makeError(3)])
189+
errors: (ext === 'js' ? [] : [makeError(2)]).concat([makeError(4)])
180190
},
181191
{
182192
filename: `test.${ext}`,
183-
code: `let foo = { }
184-
// @vue/component
185-
export let bar = { }
186-
// ${ext}`,
193+
code: `
194+
let foo = { }
195+
// @vue/component
196+
export let bar = { }
197+
// ${ext}
198+
`,
187199
parserOptions,
188-
errors: [makeError(3)]
200+
errors: [makeError(4)]
189201
},
190202
{
191203
filename: `test.${ext}`,
192-
code: `export var dar = { }
193-
// @vue/component
194-
foo({ })
195-
bar({ })
196-
// ${ext}`,
204+
code: `
205+
export var dar = { }
206+
// @vue/component
207+
foo({ })
208+
bar({ })
209+
// ${ext}
210+
`,
197211
parserOptions,
198-
errors: [makeError(3)]
212+
errors: [makeError(4)]
199213
},
200214
{
201215
filename: `test.${ext}`,
202-
code: `foo({ })
203-
export default {
204-
test: {},
205-
// @vue/component
206-
foo: { }
207-
}
208-
bar({ })
209-
// ${ext}`,
216+
code: `
217+
foo({ })
218+
export default {
219+
test: {},
220+
// @vue/component
221+
foo: { }
222+
}
223+
bar({ })
224+
// ${ext}
225+
`,
210226
parserOptions,
211-
errors: (ext === 'js' ? [] : [makeError(2)]).concat([makeError(5)])
227+
errors: (ext === 'js' ? [] : [makeError(3)]).concat([makeError(6)])
212228
},
213229
{
214230
filename: `test.${ext}`,
215-
code: `export default {
216-
bar () {
217-
return {}
218-
},
219-
foo () {
220-
// @vue/component
221-
return {}
231+
code: `
232+
export default {
233+
bar () {
234+
return {}
235+
},
236+
foo () {
237+
// @vue/component
238+
return {}
239+
}
222240
}
223-
}
224-
// ${ext}`,
241+
// ${ext}
242+
`,
225243
parserOptions,
226-
errors: (ext === 'js' ? [] : [makeError(1)]).concat([makeError(7)])
244+
errors: (ext === 'js' ? [] : [makeError(2)]).concat([makeError(8)])
227245
}
228246
]
229247
}

0 commit comments

Comments
 (0)