test: fix linter spec

This commit is contained in:
Evan You
2018-01-16 14:52:43 -05:00
parent 100c5c66e7
commit 0688e8889c
2 changed files with 35 additions and 9 deletions
@@ -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',