File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
integration/cli/build-watch Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ export default defineConfig({
127127 fse . removeSync ( srcIndexFile ) ;
128128
129129 // change
130- const wait = await awaitFileChanges ( distFooFile ) ;
130+ const wait = await awaitFileChanges ( distFooFile , 'foo1' ) ;
131131 fse . outputFileSync ( srcFooFile , `export const foo = 'foo1';` ) ;
132132 await wait ( ) ;
133133 const content3 = await fse . readFile ( distFooFile , 'utf-8' ) ;
Original file line number Diff line number Diff line change @@ -95,13 +95,16 @@ export const awaitFileExists = async (dir: string) => {
9595 }
9696} ;
9797
98- export const awaitFileChanges = async ( file : string ) => {
98+ export const awaitFileChanges = async ( file : string , content : string ) => {
9999 const oldContent = await fse . readFile ( file , 'utf-8' ) ;
100100 return async ( ) => {
101101 const result = await waitFor (
102102 ( ) => {
103103 try {
104- return fse . readFileSync ( file , 'utf-8' ) !== oldContent ;
104+ return (
105+ fse . readFileSync ( file , 'utf-8' ) !== oldContent &&
106+ fse . readFileSync ( file , 'utf-8' ) . includes ( content )
107+ ) ;
105108 } catch ( e ) {
106109 return false ;
107110 }
You can’t perform that action at this time.
0 commit comments