File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
playground/hmr-ssr/__tests__ Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -824,22 +824,29 @@ if (!isBuild) {
824
824
825
825
const parentFile = 'file-delete-restore/parent.js'
826
826
const childFile = 'file-delete-restore/child.js'
827
+ const originalChildFileCode = readFile ( childFile )
827
828
828
- // delete the file
829
- editFile ( parentFile , ( code ) =>
830
- code . replace (
831
- "export { value as childValue } from './child'" ,
832
- "export const childValue = 'not-child'" ,
833
- ) ,
829
+ await untilConsoleLogAfter (
830
+ ( ) => {
831
+ // delete the file
832
+ editFile ( parentFile , ( code ) =>
833
+ code . replace (
834
+ "export { value as childValue } from './child'" ,
835
+ "export const childValue = 'not-child'" ,
836
+ ) ,
837
+ )
838
+ removeFile ( childFile )
839
+ } ,
840
+ [
841
+ 'file-delete-restore/child.js is disposed' ,
842
+ 'file-delete-restore/child.js is pruned' ,
843
+ ] ,
844
+ false ,
834
845
)
835
- const originalChildFileCode = readFile ( childFile )
836
- removeFile ( childFile )
837
846
838
847
await expect
839
848
. poll ( ( ) => hmr ( '.file-delete-restore' ) )
840
849
. toMatch ( 'parent:not-child' )
841
- expect ( clientLogs ) . to . include ( 'file-delete-restore/child.js is disposed' )
842
- expect ( clientLogs ) . to . include ( 'file-delete-restore/child.js is pruned' )
843
850
844
851
// restore the file
845
852
addFile ( childFile , originalChildFileCode )
You can’t perform that action at this time.
0 commit comments