File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
packages/compiler-sfc/__tests__ Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -376,7 +376,31 @@ h1 { color: red }
376
376
expect ( descriptor . scriptSetup ?. lang ) . toBe ( 'tsx' )
377
377
} )
378
378
379
- test ( 'source cache key conflict' , ( ) => {
379
+ test ( 'source cache key conflict when default lang="undefined"' , ( ) => {
380
+ expect (
381
+ parse (
382
+ `
383
+ <script>console.log(0x011)</script>
384
+ <script setup>console.log(0x011)</script>
385
+ ` ,
386
+ {
387
+ defaultScriptLang : 'undefined'
388
+ }
389
+ ) . errors . length
390
+ ) . toBe ( 0 )
391
+
392
+ const { descriptor, errors } = parse (
393
+ `
394
+ <script>console.log(0x011)</script>
395
+ <script setup>console.log(0x011)</script>
396
+ `
397
+ )
398
+ expect ( errors . length ) . toBe ( 0 )
399
+ expect ( descriptor . script ?. lang ) . toBeUndefined ( )
400
+ expect ( descriptor . scriptSetup ?. lang ) . toBeUndefined ( )
401
+ } )
402
+
403
+ test ( 'source cache key conflict when default lang=""' , ( ) => {
380
404
expect (
381
405
parse (
382
406
`
You can’t perform that action at this time.
0 commit comments