Skip to content

Commit 0688e88

Browse files
committed
test: fix linter spec
1 parent 100c5c6 commit 0688e88

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

packages/@vue/cli/lib/promptModules/__tests__/linter.spec.js

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ test('base', async () => {
1313
check: [0]
1414
},
1515
{
16-
message: 'Pick a lint config',
17-
choices: ['error prevention only', 'Airbnb', 'Standard'],
16+
message: 'Pick a linter / formatter config',
17+
choices: ['error prevention only', 'Airbnb', 'Standard', 'Prettier'],
1818
choose: 0
1919
},
2020
{
@@ -49,12 +49,9 @@ test('airbnb', async () => {
4949
check: [0]
5050
},
5151
{
52-
message: 'Pick a lint config',
53-
choices: ['error prevention only', 'Airbnb', 'Standard'],
5452
choose: 1
5553
},
5654
{
57-
choices: ['on save', 'on commit'],
5855
check: [1]
5956
}
6057
]
@@ -84,12 +81,9 @@ test('standard', async () => {
8481
check: [0]
8582
},
8683
{
87-
message: 'Pick a lint config',
88-
choices: ['error prevention only', 'Airbnb', 'Standard'],
8984
choose: 2
9085
},
9186
{
92-
choices: ['on save', 'on commit'],
9387
check: []
9488
}
9589
]
@@ -110,3 +104,35 @@ test('standard', async () => {
110104
{ plguinsOnly: true }
111105
)
112106
})
107+
108+
test('prettier', async () => {
109+
const expectedPrompts = [
110+
{
111+
message: 'features',
112+
choices: ['Linter'],
113+
check: [0]
114+
},
115+
{
116+
choose: 3
117+
},
118+
{
119+
check: [0]
120+
}
121+
]
122+
123+
const expectedOptions = {
124+
plugins: {
125+
'@vue/cli-plugin-eslint': {
126+
config: 'prettier',
127+
lintOn: ['save']
128+
}
129+
}
130+
}
131+
132+
await assertPromptModule(
133+
moduleToTest,
134+
expectedPrompts,
135+
expectedOptions,
136+
{ plguinsOnly: true }
137+
)
138+
})

packages/@vue/cli/lib/promptModules/linter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = cli => {
1515
!answers.features.includes('ts')
1616
),
1717
type: 'list',
18-
message: 'Pick a lint config:',
18+
message: 'Pick a linter / formatter config:',
1919
choices: [
2020
{
2121
name: 'ESLint with error prevention only',

0 commit comments

Comments
 (0)