mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-03-13 12:40:18 -05:00
test: fix eslint related tests
This commit is contained in:
@@ -9,6 +9,7 @@ test('base', async () => {
|
||||
|
||||
expect(pkg.scripts.lint).toBeTruthy()
|
||||
expect(pkg.eslintConfig).toEqual({
|
||||
root: true,
|
||||
extends: ['plugin:vue/essential', 'eslint:recommended']
|
||||
})
|
||||
})
|
||||
@@ -24,6 +25,7 @@ test('airbnb', async () => {
|
||||
|
||||
expect(pkg.scripts.lint).toBeTruthy()
|
||||
expect(pkg.eslintConfig).toEqual({
|
||||
root: true,
|
||||
extends: ['plugin:vue/essential', '@vue/airbnb']
|
||||
})
|
||||
expect(pkg.devDependencies).toHaveProperty('@vue/eslint-config-airbnb')
|
||||
@@ -40,6 +42,7 @@ test('standard', async () => {
|
||||
|
||||
expect(pkg.scripts.lint).toBeTruthy()
|
||||
expect(pkg.eslintConfig).toEqual({
|
||||
root: true,
|
||||
extends: ['plugin:vue/essential', '@vue/standard']
|
||||
})
|
||||
expect(pkg.devDependencies).toHaveProperty('@vue/eslint-config-standard')
|
||||
@@ -56,6 +59,7 @@ test('prettier', async () => {
|
||||
|
||||
expect(pkg.scripts.lint).toBeTruthy()
|
||||
expect(pkg.eslintConfig).toEqual({
|
||||
root: true,
|
||||
extends: ['plugin:vue/essential', '@vue/prettier']
|
||||
})
|
||||
expect(pkg.devDependencies).toHaveProperty('@vue/eslint-config-prettier')
|
||||
@@ -79,6 +83,7 @@ test('typescript', async () => {
|
||||
|
||||
expect(pkg.scripts.lint).toBeTruthy()
|
||||
expect(pkg.eslintConfig).toEqual({
|
||||
root: true,
|
||||
extends: ['plugin:vue/essential', '@vue/prettier', '@vue/typescript']
|
||||
})
|
||||
expect(pkg.devDependencies).toHaveProperty('@vue/eslint-config-prettier')
|
||||
|
||||
@@ -28,6 +28,7 @@ async function assertUpdates (project) {
|
||||
|
||||
const eslintrc = JSON.parse(await project.read('.eslintrc'))
|
||||
expect(eslintrc).toEqual({
|
||||
root: true,
|
||||
extends: ['plugin:vue/essential', '@vue/airbnb']
|
||||
})
|
||||
|
||||
@@ -79,6 +80,7 @@ test('invoke with existing files', async () => {
|
||||
|
||||
const eslintrc = JSON.parse(await project.read('.eslintrc'))
|
||||
expect(eslintrc).toEqual({
|
||||
root: true,
|
||||
extends: ['plugin:vue/essential', 'eslint:recommended']
|
||||
})
|
||||
|
||||
@@ -104,11 +106,13 @@ test('invoke with existing files (yaml)', async () => {
|
||||
|
||||
const eslintrc = JSON.parse(await project.read('.eslintrc'))
|
||||
expect(eslintrc).toEqual({
|
||||
root: true,
|
||||
extends: ['plugin:vue/essential', 'eslint:recommended']
|
||||
})
|
||||
|
||||
await project.rm(`.eslintrc`)
|
||||
await project.write(`.eslintrc.yml`, `
|
||||
root: true
|
||||
extends:
|
||||
- 'plugin:vue/essential'
|
||||
- 'eslint:recommended'
|
||||
@@ -118,6 +122,7 @@ extends:
|
||||
|
||||
const updated = await project.read('.eslintrc.yml')
|
||||
expect(updated).toMatch(`
|
||||
root: true
|
||||
extends:
|
||||
- 'plugin:vue/essential'
|
||||
- '@vue/airbnb'
|
||||
|
||||
Reference in New Issue
Block a user