File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
packages/@vue/cli-plugin-typescript Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,12 @@ test('classComponent', async () => {
35
35
36
36
expect ( files [ 'tsconfig.json' ] ) . toMatch ( `"experimentalDecorators": true` )
37
37
expect ( files [ 'tsconfig.json' ] ) . toMatch ( `"emitDecoratorMetadata": true` )
38
- expect ( files [ 'src/App.vue' ] ) . toMatch ( `export default class App extends Vue {` )
39
- expect ( files [ 'src/components/HelloWorld.vue' ] ) . toMatch ( `export default class HelloWorld extends Vue {` )
38
+ expect ( files [ 'src/App.vue' ] ) . toMatch (
39
+ `export default class App extends Vue {`
40
+ )
41
+ expect ( files [ 'src/components/HelloWorld.vue' ] ) . toMatch (
42
+ `export default class HelloWorld extends Vue {`
43
+ )
40
44
} )
41
45
42
46
test ( 'use with Babel' , async ( ) => {
@@ -96,6 +100,19 @@ test('lint with no lintOnSave', async () => {
96
100
expect ( pkg . vue ) . toEqual ( { lintOnSave : false } )
97
101
} )
98
102
103
+ test ( 'tsconfig.json should be valid json' , async ( ) => {
104
+ const { files } = await generateWithPlugin ( [
105
+ {
106
+ id : 'ts' ,
107
+ apply : require ( '../generator' ) ,
108
+ options : { }
109
+ }
110
+ ] )
111
+ expect ( ( ) => {
112
+ JSON . parse ( files [ 'tsconfig.json' ] )
113
+ } ) . not . toThrow ( )
114
+ } )
115
+
99
116
test ( 'compat with unit-mocha' , async ( ) => {
100
117
const { pkg } = await generateWithPlugin ( [
101
118
{
Original file line number Diff line number Diff line change 13
13
"sourceMap" : true ,
14
14
"baseUrl" : " ." ,
15
15
"types" : [
16
- " node" ,
17
- <%_ if (hasMocha) { _%>
16
+ " node" <%_ if (hasMocha) { _%>,
18
17
"mocha" ,
19
18
"chai"
20
- <%_ } else if (hasJest) { _%>
19
+ <%_ } else if (hasJest) { _%>,
21
20
"jest"
22
21
<%_ } _%>
23
22
],
You can’t perform that action at this time.
0 commit comments