summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/_fs/_fs_appendFile_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit_node/_fs/_fs_appendFile_test.ts')
-rw-r--r--cli/tests/unit_node/_fs/_fs_appendFile_test.ts6
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);