@@ -280,6 +280,38 @@ describe('src imports', () => {
280
280
} )
281
281
} )
282
282
283
+ describe ( 'external src imports' , ( ) => {
284
+ test ( 'script src with ts' , async ( ) => {
285
+ expect ( await page . textContent ( '.external-src-imports-script' ) ) . toMatch (
286
+ 'hello from script src' ,
287
+ )
288
+ editFile ( '../vue-external/src-import/script.ts' , ( code ) =>
289
+ code . replace ( 'hello from script src' , 'updated' ) ,
290
+ )
291
+ await untilUpdated (
292
+ ( ) => page . textContent ( '.external-src-imports-script' ) ,
293
+ 'updated' ,
294
+ )
295
+ } )
296
+
297
+ test ( 'style src' , async ( ) => {
298
+ const el = await page . $ ( '.external-src-imports-style' )
299
+ expect ( await getColor ( el ) ) . toBe ( 'tan' )
300
+ editFile ( '../vue-external/src-import/style.css' , ( code ) =>
301
+ code . replace ( 'color: tan' , 'color: red' ) ,
302
+ )
303
+ await untilUpdated ( ( ) => getColor ( el ) , 'red' )
304
+ } )
305
+
306
+ test ( 'template src import hmr' , async ( ) => {
307
+ const el = await page . $ ( '.external-src-imports-style' )
308
+ editFile ( '../vue-external/src-import/template.html' , ( code ) =>
309
+ code . replace ( 'should be tan' , 'should be red' ) ,
310
+ )
311
+ await untilUpdated ( ( ) => el . textContent ( ) , 'should be red' )
312
+ } )
313
+ } )
314
+
283
315
describe ( 'custom blocks' , ( ) => {
284
316
test ( 'should work' , async ( ) => {
285
317
expect ( await page . textContent ( '.custom-block' ) ) . toMatch ( 'こんにちは' )
0 commit comments