File tree 1 file changed +12
-0
lines changed
packages/@vue/cli-plugin-typescript/__tests__
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,22 @@ test('should work', async () => {
13
13
const { read, write, run } = project
14
14
const main = await read ( 'src/main.ts' )
15
15
expect ( main ) . toMatch ( ';' )
16
+ const app = await read ( 'src/App.vue' )
17
+ expect ( main ) . toMatch ( ';' )
16
18
// remove semicolons
17
19
const updatedMain = main . replace ( / ; / g, '' )
18
20
await write ( 'src/main.ts' , updatedMain )
21
+ // for Vue file, only remove semis in script section
22
+ const updatedApp = app . replace ( / < s c r i p t ( .| \n ) * \/ s c r i p t > / , $ => {
23
+ return $ . replace ( / ; / g, '' )
24
+ } )
25
+ await write ( 'src/App.vue' , updatedApp )
19
26
// lint
20
27
await run ( 'vue-cli-service lint' )
21
28
expect ( await read ( 'src/main.ts' ) ) . toMatch ( ';' )
29
+
30
+ const lintedApp = await read ( 'src/App.vue' )
31
+ expect ( lintedApp ) . toMatch ( ';' )
32
+ // test if tslint is fixing vue files properly
33
+ expect ( lintedApp ) . toBe ( app )
22
34
} )
You can’t perform that action at this time.
0 commit comments