Skip to content

Commit ccb46f9

Browse files
committed
test: run eslint v8 test in the e2e job
1 parent 220e019 commit ccb46f9

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
jest.setTimeout(300000)
2+
3+
const createOutside = require('@vue/cli-test-utils/createUpgradableProject')
4+
5+
// This test must be run in the E2E environment (with a local registry).
6+
// Because the installation of ESLint v8 will break the test environment of the project
7+
test(`should work with eslint v8`, async () => {
8+
const project = await createOutside('eslint-v8', {
9+
plugins: {
10+
'@vue/cli-plugin-babel': {},
11+
'@vue/cli-plugin-eslint': {
12+
config: 'airbnb',
13+
lintOn: 'save'
14+
}
15+
}
16+
})
17+
const { read, write, run } = project
18+
await run('yarn add -D eslint@8')
19+
// should've applied airbnb autofix
20+
const main = await read('src/main.js')
21+
expect(main).toMatch(';')
22+
// remove semicolons
23+
const updatedMain = main.replace(/;/g, '')
24+
await write('src/main.js', updatedMain)
25+
// lint
26+
await run('vue-cli-service lint')
27+
expect(await read('src/main.js')).toMatch(';')
28+
})

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -274,29 +274,6 @@ test.skip(`should use formatter 'stylish'`, async () => {
274274
await donePromise
275275
})
276276

277-
test(`should work with eslint v8`, async () => {
278-
const project = await create('eslint-v8', {
279-
plugins: {
280-
'@vue/cli-plugin-babel': {},
281-
'@vue/cli-plugin-eslint': {
282-
config: 'airbnb',
283-
lintOn: 'save'
284-
}
285-
}
286-
})
287-
const { read, write, run } = project
288-
await run('npm add -D eslint@8 --legacy-peer-deps')
289-
// should've applied airbnb autofix
290-
const main = await read('src/main.js')
291-
expect(main).toMatch(';')
292-
// remove semicolons
293-
const updatedMain = main.replace(/;/g, '')
294-
await write('src/main.js', updatedMain)
295-
// lint
296-
await run('vue-cli-service lint')
297-
expect(await read('src/main.js')).toMatch(';')
298-
})
299-
300277
test(`should work with eslint args`, async () => {
301278
const project = await create('eslint-with-args', {
302279
plugins: {

scripts/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (args.p) {
1010
rawArgs.splice(i, 2)
1111
}
1212

13-
const e2ePathPattern = 'Migrator|Vue3|mochaPlugin|MochaPlugin'
13+
const e2ePathPattern = 'Migrator|Vue3|mochaPlugin|MochaPlugin|eslint8'
1414

1515
if (args['e2e-only']) {
1616
regex = e2ePathPattern

0 commit comments

Comments
 (0)