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_appendFile_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_appendFile_test.ts')
-rw-r--r-- | cli/tests/unit_node/_fs/_fs_appendFile_test.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cli/tests/unit_node/_fs/_fs_appendFile_test.ts b/cli/tests/unit_node/_fs/_fs_appendFile_test.ts index e70d3401f..a7dec7e7c 100644 --- a/cli/tests/unit_node/_fs/_fs_appendFile_test.ts +++ b/cli/tests/unit_node/_fs/_fs_appendFile_test.ts @@ -70,7 +70,7 @@ Deno.test({ name: "Async: Data is written to passed in rid", 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, @@ -88,7 +88,6 @@ Deno.test({ fail("No error expected"); }) .finally(async () => { - Deno.close(file.rid); await Deno.remove(tempFile); }); }, @@ -160,13 +159,12 @@ Deno.test({ name: "Sync: Data is written to passed in rid", fn() { const tempFile: string = Deno.makeTempFileSync(); - const file: Deno.FsFile = Deno.openSync(tempFile, { + using file = Deno.openSync(tempFile, { create: true, write: true, read: true, }); appendFileSync(file.rid, "hello world"); - Deno.close(file.rid); const data = Deno.readFileSync(tempFile); assertEquals(decoder.decode(data), "hello world"); Deno.removeSync(tempFile); |