@@ -71,42 +71,21 @@ describe('Single File Component parser', () => {
71
71
const padLine = parseComponent ( content . trim ( ) , { pad : 'line' } )
72
72
const padSpace = parseComponent ( content . trim ( ) , { pad : 'space' } )
73
73
74
- expect ( padDefault . template . content ) . toBe ( Array ( 1 ) . join ( '\n' ) + `
75
- <div></div>
76
- ` )
77
- expect ( padDefault . script . content ) . toBe ( Array ( 3 + 1 ) . join ( '//\n' ) + `
78
- export default {}
79
- ` )
80
- expect ( padDefault . styles [ 0 ] . content ) . toBe ( Array ( 6 + 1 ) . join ( '\n' ) + `
81
- h1 { color: red }
82
- ` )
83
- expect ( padLine . template . content ) . toBe ( Array ( 1 ) . join ( '\n' ) + `
84
- <div></div>
85
- ` )
86
- expect ( padLine . script . content ) . toBe ( Array ( 3 + 1 ) . join ( '//\n' ) + `
87
- export default {}
88
- ` )
89
- expect ( padLine . styles [ 0 ] . content ) . toBe ( Array ( 6 + 1 ) . join ( '\n' ) + `
90
- h1 { color: red }
91
- ` )
92
- expect ( padSpace . template . content ) . toBe ( `<template>` . replace ( / ./ g, ' ' ) + `
93
- <div></div>
94
- ` )
74
+ expect ( padDefault . script . content ) . toBe ( Array ( 3 + 1 ) . join ( '//\n' ) + '\nexport default {}\n' )
75
+ expect ( padDefault . styles [ 0 ] . content ) . toBe ( Array ( 6 + 1 ) . join ( '\n' ) + '\nh1 { color: red }\n' )
76
+ expect ( padLine . script . content ) . toBe ( Array ( 3 + 1 ) . join ( '//\n' ) + '\nexport default {}\n' )
77
+ expect ( padLine . styles [ 0 ] . content ) . toBe ( Array ( 6 + 1 ) . join ( '\n' ) + '\nh1 { color: red }\n' )
95
78
expect ( padSpace . script . content ) . toBe ( `<template>
96
79
<div></div>
97
80
</template>
98
- <script>` . replace ( / ./ g, ' ' ) + `
99
- export default {}
100
- ` )
81
+ <script>` . replace ( / ./ g, ' ' ) + '\nexport default {}\n' )
101
82
expect ( padSpace . styles [ 0 ] . content ) . toBe ( `<template>
102
83
<div></div>
103
84
</template>
104
85
<script>
105
86
export default {}
106
87
</script>
107
- <style>` . replace ( / ./ g, ' ' ) + `
108
- h1 { color: red }
109
- ` )
88
+ <style>` . replace ( / ./ g, ' ' ) + '\nh1 { color: red }\n' )
110
89
} )
111
90
112
91
it ( 'should handle template blocks with lang as special text' , ( ) => {
0 commit comments