File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed
Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -489,25 +489,25 @@ extensionTest.describe("lsp", async () => {
489489 await expect (
490490 page . getByRole ( "button" , { name : "check Buf" } )
491491 ) . toBeVisible ( ) ;
492+
493+ const { promise, resolve, reject } = Promise . withResolvers < string > ( ) ;
492494 const watcher = fs . watch ( path . join ( projectPath , "example.proto" ) ) ;
493- const formattedFileContent = new Promise ( ( resolve , reject ) => {
494- watcher . on ( "change" , ( ) => {
495- watcher . close ( ) ;
496- fs . readFile (
497- path . join ( projectPath , "example.proto" ) ,
498- { encoding : "utf8" } ,
499- ( err , data ) => {
500- if ( err ) {
501- reject ( err ) ;
502- }
503- resolve ( data . toString ( ) ) ;
495+ watcher . on ( "change" , ( ) => {
496+ watcher . close ( ) ;
497+ fs . readFile (
498+ path . join ( projectPath , "example.proto" ) ,
499+ { encoding : "utf8" } ,
500+ ( err , data ) => {
501+ if ( err ) {
502+ reject ( err ) ;
504503 }
505- ) ;
506- } ) ;
504+ resolve ( data . toString ( ) ) ;
505+ }
506+ ) ;
507507 } ) ;
508508
509509 await page . keyboard . press ( "ControlOrMeta+KeyS" ) ;
510- const currentContent = await formattedFileContent ;
510+ const currentContent = await promise ;
511511 expect ( currentContent ) . toBe ( exampleUserProto ) ;
512512 } ) ;
513513 } ) ;
Original file line number Diff line number Diff line change 33 "module" : " Node16" ,
44 "target" : " ES2022" ,
55 "outDir" : " out" ,
6- "lib" : [" ES2022 " ],
6+ "lib" : [" ES2024 " ],
77 "skipLibCheck" : true ,
88 "sourceMap" : true ,
99 "strict" : true /* enable all strict type-checking options */ ,
You can’t perform that action at this time.
0 commit comments