Skip to content

Commit 35cf094

Browse files
committed
test: fix eslint generator tests
1 parent 74321f3 commit 35cf094

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/@vue/cli-plugin-eslint/__tests__/eslintGenerator.spec.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,19 @@ test('typescript', async () => {
135135
})
136136

137137
test('lint on save', async () => {
138-
const { pkg } = await generateWithPlugin({
138+
const { files } = await generateWithPlugin({
139139
id: 'eslint',
140140
apply: require('../generator'),
141141
options: {
142142
lintOn: 'save'
143143
}
144144
})
145145
// lintOnSave defaults to true so no need for the vue config
146-
expect(pkg.vue).toBeFalsy()
146+
expect(files['vue.config.js']).toBeUndefined()
147147
})
148148

149149
test('lint on commit', async () => {
150-
const { pkg } = await generateWithPlugin({
150+
const { pkg, files } = await generateWithPlugin({
151151
id: 'eslint',
152152
apply: require('../generator'),
153153
options: {
@@ -159,9 +159,7 @@ test('lint on commit', async () => {
159159
expect(pkg['lint-staged']).toEqual({
160160
'*.{js,jsx,vue}': 'vue-cli-service lint'
161161
})
162-
expect(pkg.vue).toEqual({
163-
lintOnSave: false
164-
})
162+
expect(files['vue.config.js']).toMatch('lintOnSave: false')
165163
})
166164

167165
test('should lint ts files when typescript plugin co-exists', async () => {

0 commit comments

Comments
 (0)