diff options
-rw-r--r-- | cli/tests/unit_node/_fs/_fs_handle_test.ts | 2 | ||||
-rw-r--r-- | ext/node/polyfills/internal/fs/handle.ts | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/cli/tests/unit_node/_fs/_fs_handle_test.ts b/cli/tests/unit_node/_fs/_fs_handle_test.ts index c1e5ef871..165608e1c 100644 --- a/cli/tests/unit_node/_fs/_fs_handle_test.ts +++ b/cli/tests/unit_node/_fs/_fs_handle_test.ts @@ -16,5 +16,5 @@ Deno.test("readFileSuccess", async function () { assert(data instanceof Uint8Array); assertEquals(new TextDecoder().decode(data as Uint8Array), "hello world"); - Deno.close(fileHandle.fd); + await fileHandle.close(); }); diff --git a/ext/node/polyfills/internal/fs/handle.ts b/ext/node/polyfills/internal/fs/handle.ts index a369a4a4d..a1ee263ea 100644 --- a/ext/node/polyfills/internal/fs/handle.ts +++ b/ext/node/polyfills/internal/fs/handle.ts @@ -24,6 +24,11 @@ export class FileHandle extends EventEmitter { ): Promise<string | Buffer> { return promises.readFile(this, opt); } + + close(): Promise<void> { + // Note that Deno.close is not async + return Promise.resolve(Deno.close(this.fd)); + } } export default { |