@@ -6,7 +6,7 @@ const assertPromptModule = require('@vue/cli-test-utils/assertPromptModule')
6
6
const moduleToTest = require ( '../typescript' )
7
7
const linterModule = require ( '../linter' )
8
8
9
- test ( 'should work ' , async ( ) => {
9
+ test ( 'with TSLint ' , async ( ) => {
10
10
const expectedPrompts = [
11
11
{
12
12
message : 'features' ,
@@ -21,6 +21,11 @@ test('should work', async () => {
21
21
message : 'Use Babel' ,
22
22
confirm : true
23
23
} ,
24
+ {
25
+ message : 'Pick a linter / formatter' ,
26
+ choices : [ 'TSLint' , 'error prevention' , 'Airbnb' , 'Standard' , 'Prettier' ] ,
27
+ choose : [ 0 ]
28
+ } ,
24
29
{
25
30
message : 'Pick additional lint features' ,
26
31
choices : [ 'on save' , 'on commit' ] ,
@@ -32,7 +37,7 @@ test('should work', async () => {
32
37
plugins : {
33
38
'@vue/cli-plugin-typescript' : {
34
39
classComponent : true ,
35
- lint : true ,
40
+ tsLint : true ,
36
41
lintOn : [ 'save' , 'commit' ] ,
37
42
useTsWithBabel : true
38
43
}
@@ -46,3 +51,51 @@ test('should work', async () => {
46
51
{ plguinsOnly : true }
47
52
)
48
53
} )
54
+
55
+ test ( 'with ESLint' , async ( ) => {
56
+ const expectedPrompts = [
57
+ {
58
+ message : 'features' ,
59
+ choices : [ 'TypeScript' , 'Linter' ] ,
60
+ check : [ 0 , 1 ]
61
+ } ,
62
+ {
63
+ message : 'Use class-style component' ,
64
+ confirm : true
65
+ } ,
66
+ {
67
+ message : 'Use Babel' ,
68
+ confirm : true
69
+ } ,
70
+ {
71
+ message : 'Pick a linter / formatter' ,
72
+ choices : [ 'TSLint' , 'error prevention' , 'Airbnb' , 'Standard' , 'Prettier' ] ,
73
+ choose : [ 2 ]
74
+ } ,
75
+ {
76
+ message : 'Pick additional lint features' ,
77
+ choices : [ 'on save' , 'on commit' ] ,
78
+ check : [ 0 , 1 ]
79
+ }
80
+ ]
81
+
82
+ const expectedOptions = {
83
+ plugins : {
84
+ '@vue/cli-plugin-eslint' : {
85
+ config : 'airbnb' ,
86
+ lintOn : [ 'save' , 'commit' ]
87
+ } ,
88
+ '@vue/cli-plugin-typescript' : {
89
+ classComponent : true ,
90
+ useTsWithBabel : true
91
+ }
92
+ }
93
+ }
94
+
95
+ await assertPromptModule (
96
+ [ moduleToTest , linterModule ] ,
97
+ expectedPrompts ,
98
+ expectedOptions ,
99
+ { plguinsOnly : true }
100
+ )
101
+ } )
0 commit comments