@@ -277,6 +277,9 @@ if (!isBuild) {
277277 await untilUpdated ( ( ) => el . textContent ( ) , 'edited' )
278278 } )
279279
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.
280283 test ( 'plugin hmr remove custom events' , async ( ) => {
281284 const el = await page . $ ( '.toRemove' )
282285 editFile ( 'customFile.js' , ( code ) => code . replace ( 'custom' , 'edited' ) )
@@ -342,6 +345,7 @@ if (!isBuild) {
342345 } )
343346 }
344347
348+ // TODO(underfin): recheck it
345349 if ( ! process . env . VITE_TEST_FULL_BUNDLE_MODE ) {
346350 test ( 'not loaded dynamic import' , async ( ) => {
347351 await page . goto ( viteTestUrl + '/counter/index.html' , {
@@ -378,33 +382,35 @@ if (!isBuild) {
378382 btn = await page . $ ( 'button' )
379383 expect ( await btn . textContent ( ) ) . toBe ( 'Counter 1' )
380384 } )
385+ }
381386
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+ }
389394
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>' ) )
391396
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+ )
397402
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+ } )
407412
413+ if ( ! process . env . VITE_TEST_FULL_BUNDLE_MODE ) {
408414 describe ( 'acceptExports' , ( ) => {
409415 const HOT_UPDATED = / h o t u p d a t e d /
410416 const CONNECTED = / c o n n e c t e d /
0 commit comments