Skip to content

Commit fe4a932

Browse files
committed
Rename:
notFoundTests -> validTests foundTests -> invalidTests Internal test: component. -> Component detected.
1 parent 8836613 commit fe4a932

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

tests/lib/utils/vue-component.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const rule = {
1414
return utils.executeOnVueComponent(context, obj => {
1515
context.report({
1616
node: obj,
17-
message: 'Internal test: component.'
17+
message: 'Component detected.'
1818
})
1919
})
2020
},
@@ -32,13 +32,13 @@ const parserOptions = {
3232

3333
function makeError (line) {
3434
return {
35-
message: 'Internal test: component.',
35+
message: 'Component detected.',
3636
line,
3737
type: 'ObjectExpression'
3838
}
3939
}
4040

41-
function notFoundTests (ext) {
41+
function validTests (ext) {
4242
return [
4343
{
4444
filename: `test.${ext}`,
@@ -100,15 +100,16 @@ function notFoundTests (ext) {
100100
]
101101
}
102102

103-
function foundTests (ext) {
103+
function invalidTests (ext) {
104104
return [
105105
{
106106
filename: `test.${ext}`,
107-
code: `// ${ext}
107+
code: `
108108
Vue.component('async-example', function (resolve, reject) {
109109
// @vue/component
110110
resolve({})
111-
})`,
111+
})
112+
// ${ext}`,
112113
parserOptions,
113114
errors: [makeError(4)]
114115
},
@@ -120,15 +121,16 @@ function foundTests (ext) {
120121
},
121122
{
122123
filename: `test.${ext}`,
123-
code: `// ${ext}
124+
code: `
124125
// @vue/component
125-
export default { }`,
126+
export default { }
127+
// ${ext}`,
126128
parserOptions,
127129
errors: [makeError(3)]
128130
},
129131
{
130132
filename: `test.${ext}`,
131-
code: `// ${ext}
133+
code: `
132134
/* @vue/component */
133135
export default { }
134136
// ${ext}`,
@@ -239,7 +241,7 @@ ruleTester.run('vue-component', rule, {
239241
code: `export default { }`,
240242
parserOptions
241243
}
242-
].concat(notFoundTests('js')).concat(notFoundTests('jsx')).concat(notFoundTests('vue')),
244+
].concat(validTests('js')).concat(validTests('jsx')).concat(validTests('vue')),
243245
invalid: [
244246
{
245247
filename: 'test.vue',
@@ -253,5 +255,5 @@ ruleTester.run('vue-component', rule, {
253255
parserOptions,
254256
errors: [makeError(1)]
255257
}
256-
].concat(foundTests('js')).concat(foundTests('jsx')).concat(foundTests('vue'))
258+
].concat(invalidTests('js')).concat(invalidTests('jsx')).concat(invalidTests('vue'))
257259
})

0 commit comments

Comments
 (0)