@@ -89,7 +89,7 @@ describe('"minimize" option', () => {
89
89
) ;
90
90
} ) ;
91
91
92
- it ( 'should preserve comments ' , ( ) => {
92
+ it ( 'should support options for minimizer ' , ( ) => {
93
93
const result = loader . call (
94
94
{
95
95
query : {
@@ -115,56 +115,19 @@ describe('"minimize" option', () => {
115
115
) ;
116
116
} ) ;
117
117
118
- it ( 'should preserve comments and white spaces when minimizing ' , ( ) => {
118
+ it ( 'should support ES6 syntax ' , ( ) => {
119
119
const result = loader . call (
120
120
{
121
121
query : {
122
- minimize : {
123
- conservativeCollapse : true ,
124
- removeAttributeQuotes : true ,
125
- keepClosingSlash : true ,
126
- minifyJS : true ,
127
- minifyCSS : true ,
128
- removeScriptTypeAttributes : true ,
129
- removeStyleLinkTypeAttributes : true ,
130
- useShortDoctype : true ,
131
- removeComments : false ,
132
- collapseWhitespace : false ,
133
- } ,
134
- } ,
135
- } ,
136
- '<!-- comment --><h3 customAttr="">#{number} {customer}</h3><p>{title}</p> <!-- comment --> <img src="image.png" />'
137
- ) ;
138
-
139
- expect ( result ) . toBe (
140
- `${ GET_URL_CODE } module.exports = "<!-- comment --><h3 customattr=\\"\\">#{number} {customer}</h3><p>{title}</p> <!-- comment --> <img src=" + __url__(require("./image.png")) + " />";`
141
- ) ;
142
- } ) ;
143
-
144
- it ( 'should treat attributes as case sensitive' , ( ) => {
145
- const result = loader . call (
146
- {
147
- query : {
148
- minimize : {
149
- removeComments : true ,
150
- collapseWhitespace : true ,
151
- conservativeCollapse : true ,
152
- removeAttributeQuotes : true ,
153
- keepClosingSlash : true ,
154
- minifyJS : true ,
155
- minifyCSS : true ,
156
- removeScriptTypeAttributes : true ,
157
- removeStyleLinkTypeAttributes : true ,
158
- useShortDoctype : true ,
159
- caseSensitive : true ,
160
- } ,
122
+ minimize : true ,
161
123
} ,
162
124
} ,
163
- '<!-- comment --><h3 customAttr="">#{number} {customer}</h3><p>{title}</p><!-- comment --><img src="image.png" />'
125
+ // eslint-disable-next-line no-template-curly-in-string
126
+ '<!-- comment --><h1>My First Heading</h1>\n\n<p>My first paragraph.</p> <script> console.log(1 + 2 + `${3 + 3}`) </script>'
164
127
) ;
165
128
166
129
expect ( result ) . toBe (
167
- `${ GET_URL_CODE } module.exports = "<h3 customAttr=\\"\\">#{number} {customer}</h3> <p>{title} </p><img src=" + __url__(require("./image.png")) + " / >";`
130
+ `${ GET_URL_CODE } module.exports = "<h1>My First Heading</h1> <p>My first paragraph. </p> <script>console.log(\\"36\\")</script >";`
168
131
) ;
169
132
} ) ;
170
133
} ) ;
0 commit comments