@@ -277,6 +277,9 @@ if (!isBuild) {
277
277
await untilUpdated ( ( ) => el . textContent ( ) , 'edited' )
278
278
} )
279
279
280
+ // TODO(underfin): the customFile tests maybe make test hang.
281
+ // The `customFile.js` is not inside module graph, it couldn't be seen also hasn't hmr.
282
+ // Here only trigger hmr events.
280
283
test ( 'plugin hmr remove custom events' , async ( ) => {
281
284
const el = await page . $ ( '.toRemove' )
282
285
editFile ( 'customFile.js' , ( code ) => code . replace ( 'custom' , 'edited' ) )
@@ -342,6 +345,7 @@ if (!isBuild) {
342
345
} )
343
346
}
344
347
348
+ // TODO(underfin): recheck it
345
349
if ( ! process . env . VITE_TEST_FULL_BUNDLE_MODE ) {
346
350
test ( 'not loaded dynamic import' , async ( ) => {
347
351
await page . goto ( viteTestUrl + '/counter/index.html' , {
@@ -378,33 +382,35 @@ if (!isBuild) {
378
382
btn = await page . $ ( 'button' )
379
383
expect ( await btn . textContent ( ) ) . toBe ( 'Counter 1' )
380
384
} )
385
+ }
381
386
382
- // #2255
383
- test ( 'importing reloaded' , async ( ) => {
384
- await page . goto ( viteTestUrl )
385
- const outputEle = await page . $ ( '.importing-reloaded' )
386
- const getOutput = ( ) => {
387
- return outputEle . innerHTML ( )
388
- }
387
+ // #2255
388
+ test ( 'importing reloaded' , async ( ) => {
389
+ await page . goto ( viteTestUrl )
390
+ const outputEle = await page . $ ( '.importing-reloaded' )
391
+ const getOutput = ( ) => {
392
+ return outputEle . innerHTML ( )
393
+ }
389
394
390
- await untilUpdated ( getOutput , [ 'a.js: a0' , 'b.js: b0,a0' ] . join ( '<br>' ) )
395
+ await untilUpdated ( getOutput , [ 'a.js: a0' , 'b.js: b0,a0' ] . join ( '<br>' ) )
391
396
392
- editFile ( 'importing-updated/a.js' , ( code ) => code . replace ( "'a0'" , "'a1'" ) )
393
- await untilUpdated (
394
- getOutput ,
395
- [ 'a.js: a0' , 'b.js: b0,a0' , 'a.js: a1' ] . join ( '<br>' ) ,
396
- )
397
+ editFile ( 'importing-updated/a.js' , ( code ) => code . replace ( "'a0'" , "'a1'" ) )
398
+ await untilUpdated (
399
+ getOutput ,
400
+ [ 'a.js: a0' , 'b.js: b0,a0' , 'a.js: a1' ] . join ( '<br>' ) ,
401
+ )
397
402
398
- editFile ( 'importing-updated/b.js' , ( code ) =>
399
- code . replace ( '`b0,${a}`' , '`b1,${a}`' ) ,
400
- )
401
- // note that "a.js: a1" should not happen twice after "b.js: b0,a0'"
402
- await untilUpdated (
403
- getOutput ,
404
- [ 'a.js: a0' , 'b.js: b0,a0' , 'a.js: a1' , 'b.js: b1,a1' ] . join ( '<br>' ) ,
405
- )
406
- } )
403
+ editFile ( 'importing-updated/b.js' , ( code ) =>
404
+ code . replace ( '`b0,${a}`' , '`b1,${a}`' ) ,
405
+ )
406
+ // note that "a.js: a1" should not happen twice after "b.js: b0,a0'"
407
+ await untilUpdated (
408
+ getOutput ,
409
+ [ 'a.js: a0' , 'b.js: b0,a0' , 'a.js: a1' , 'b.js: b1,a1' ] . join ( '<br>' ) ,
410
+ )
411
+ } )
407
412
413
+ if ( ! process . env . VITE_TEST_FULL_BUNDLE_MODE ) {
408
414
describe ( 'acceptExports' , ( ) => {
409
415
const HOT_UPDATED = / h o t u p d a t e d /
410
416
const CONNECTED = / c o n n e c t e d /
0 commit comments