diff options
| author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-01-25 01:59:55 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-24 15:59:55 +0100 |
| commit | 62786cfebb5c9fe36d0930582951f442bdfe9441 (patch) | |
| tree | a1bede5492a5b1bf4a202ee8994df027f098e788 /cli/tests/unit_node/_fs/_fs_write_test.ts | |
| parent | 4af121687cb4c26f4a2f3e4ad266490d8faa3d2d (diff) | |
feat: deprecate `Deno.close()` (#22066)
For removal in Deno v2.
---------
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/tests/unit_node/_fs/_fs_write_test.ts')
| -rw-r--r-- | cli/tests/unit_node/_fs/_fs_write_test.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cli/tests/unit_node/_fs/_fs_write_test.ts b/cli/tests/unit_node/_fs/_fs_write_test.ts index 2c5c3d58e..ef538e9e4 100644 --- a/cli/tests/unit_node/_fs/_fs_write_test.ts +++ b/cli/tests/unit_node/_fs/_fs_write_test.ts @@ -9,7 +9,7 @@ Deno.test({ name: "Data is written to the file with the correct length", async fn() { const tempFile: string = await Deno.makeTempFile(); - const file: Deno.FsFile = await Deno.open(tempFile, { + using file = await Deno.open(tempFile, { create: true, write: true, read: true, @@ -21,7 +21,6 @@ Deno.test({ resolve(nwritten); }); }); - Deno.close(file.rid); const data = await Deno.readFile(tempFile); await Deno.remove(tempFile); @@ -35,14 +34,13 @@ Deno.test({ name: "Data is written synchronously to the file with the correct length", fn() { const tempFile: string = Deno.makeTempFileSync(); - const file: Deno.FsFile = Deno.openSync(tempFile, { + using file = Deno.openSync(tempFile, { create: true, write: true, read: true, }); const buffer = Buffer.from("hello world"); const bytesWrite = writeSync(file.rid, buffer, 0, 5); - Deno.close(file.rid); const data = Deno.readFileSync(tempFile); Deno.removeSync(tempFile); |
