mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-05-07 12:29:15 -05:00
test: fix linter spec
This commit is contained in:
@@ -13,8 +13,8 @@ test('base', async () => {
|
||||
check: [0]
|
||||
},
|
||||
{
|
||||
message: 'Pick a lint config',
|
||||
choices: ['error prevention only', 'Airbnb', 'Standard'],
|
||||
message: 'Pick a linter / formatter config',
|
||||
choices: ['error prevention only', 'Airbnb', 'Standard', 'Prettier'],
|
||||
choose: 0
|
||||
},
|
||||
{
|
||||
@@ -49,12 +49,9 @@ test('airbnb', async () => {
|
||||
check: [0]
|
||||
},
|
||||
{
|
||||
message: 'Pick a lint config',
|
||||
choices: ['error prevention only', 'Airbnb', 'Standard'],
|
||||
choose: 1
|
||||
},
|
||||
{
|
||||
choices: ['on save', 'on commit'],
|
||||
check: [1]
|
||||
}
|
||||
]
|
||||
@@ -84,12 +81,9 @@ test('standard', async () => {
|
||||
check: [0]
|
||||
},
|
||||
{
|
||||
message: 'Pick a lint config',
|
||||
choices: ['error prevention only', 'Airbnb', 'Standard'],
|
||||
choose: 2
|
||||
},
|
||||
{
|
||||
choices: ['on save', 'on commit'],
|
||||
check: []
|
||||
}
|
||||
]
|
||||
@@ -110,3 +104,35 @@ test('standard', async () => {
|
||||
{ plguinsOnly: true }
|
||||
)
|
||||
})
|
||||
|
||||
test('prettier', async () => {
|
||||
const expectedPrompts = [
|
||||
{
|
||||
message: 'features',
|
||||
choices: ['Linter'],
|
||||
check: [0]
|
||||
},
|
||||
{
|
||||
choose: 3
|
||||
},
|
||||
{
|
||||
check: [0]
|
||||
}
|
||||
]
|
||||
|
||||
const expectedOptions = {
|
||||
plugins: {
|
||||
'@vue/cli-plugin-eslint': {
|
||||
config: 'prettier',
|
||||
lintOn: ['save']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await assertPromptModule(
|
||||
moduleToTest,
|
||||
expectedPrompts,
|
||||
expectedOptions,
|
||||
{ plguinsOnly: true }
|
||||
)
|
||||
})
|
||||
|
||||
@@ -15,7 +15,7 @@ module.exports = cli => {
|
||||
!answers.features.includes('ts')
|
||||
),
|
||||
type: 'list',
|
||||
message: 'Pick a lint config:',
|
||||
message: 'Pick a linter / formatter config:',
|
||||
choices: [
|
||||
{
|
||||
name: 'ESLint with error prevention only',
|
||||
|
||||
Reference in New Issue
Block a user