File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -164,4 +164,26 @@ describe('options', () => {
164
164
'potato<style>potato</style><script>potato</script>' ,
165
165
) ;
166
166
} ) ;
167
+
168
+ it . only ( 'should respect lang/type attributes even if another default language is set' , async ( ) => {
169
+ const input = `<script lang="tomatoScript">script</script>` ;
170
+
171
+ const opts = getAutoPreprocess ( {
172
+ defaults : {
173
+ script : 'potatoScript' ,
174
+ } ,
175
+ potatoScript ( { content } ) {
176
+ return { code : content . replace ( 'script' , 'potato' ) } ;
177
+ } ,
178
+ tomatoScript ( { content } ) {
179
+ return { code : content . replace ( 'script' , 'tomato' ) } ;
180
+ } ,
181
+ } ) ;
182
+
183
+ const preprocessed = await preprocess ( input , opts ) ;
184
+
185
+ expect ( preprocessed . toString ( ) ) . toContain (
186
+ '<script lang="tomatoScript">tomato</script>' ,
187
+ ) ;
188
+ } ) ;
167
189
} ) ;
You can’t perform that action at this time.
0 commit comments