diff --git a/ext/node/polyfills/internal/fs/handle.ts b/ext/node/polyfills/internal/fs/handle.ts index 9ec0fc97e2..0e47f34c96 100644 --- a/ext/node/polyfills/internal/fs/handle.ts +++ b/ext/node/polyfills/internal/fs/handle.ts @@ -148,6 +148,10 @@ export class FileHandle extends EventEmitter { stat(options: { bigint: true }): Promise; stat(options?: { bigint: boolean }): Promise { return fsCall(promises.fstat, this, options); + }; + // readLines(options?):Promise + sync():Promise{ + return Promise.resolve(promises.sync()); } } diff --git a/tests/unit_node/_fs/_fs_handle_test.ts b/tests/unit_node/_fs/_fs_handle_test.ts index e26b82aa06..2c6e5121fe 100644 --- a/tests/unit_node/_fs/_fs_handle_test.ts +++ b/tests/unit_node/_fs/_fs_handle_test.ts @@ -70,6 +70,7 @@ Deno.test("[node/fs filehandle.write] Write from Buffer", async function () { const buffer = Buffer.from("hello world"); const res = await fileHandle.write(buffer, 0, 5, 0); + await fileHandle.sync(); const data = Deno.readFileSync(tempFile); await Deno.remove(tempFile);