summaryrefslogtreecommitdiff
path: root/cli/tests/unit/stat_test.ts
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-01-25 01:59:55 +1100
committerGitHub <noreply@github.com>2024-01-24 15:59:55 +0100
commit62786cfebb5c9fe36d0930582951f442bdfe9441 (patch)
treea1bede5492a5b1bf4a202ee8994df027f098e788 /cli/tests/unit/stat_test.ts
parent4af121687cb4c26f4a2f3e4ad266490d8faa3d2d (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/stat_test.ts')
-rw-r--r--cli/tests/unit/stat_test.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/cli/tests/unit/stat_test.ts b/cli/tests/unit/stat_test.ts
index cbc5909b5..ccb17b164 100644
--- a/cli/tests/unit/stat_test.ts
+++ b/cli/tests/unit/stat_test.ts
@@ -8,7 +8,7 @@ import {
} from "./test_util.ts";
Deno.test({ permissions: { read: true } }, function fstatSyncSuccess() {
- const file = Deno.openSync("README.md");
+ using file = Deno.openSync("README.md");
const fileInfo = Deno.fstatSync(file.rid);
assert(fileInfo.isFile);
assert(!fileInfo.isSymlink);
@@ -18,12 +18,10 @@ Deno.test({ permissions: { read: true } }, function fstatSyncSuccess() {
assert(fileInfo.mtime);
// The `birthtime` field is not available on Linux before kernel version 4.11.
assert(fileInfo.birthtime || Deno.build.os === "linux");
-
- Deno.close(file.rid);
});
Deno.test({ permissions: { read: true } }, async function fstatSuccess() {
- const file = await Deno.open("README.md");
+ using file = await Deno.open("README.md");
const fileInfo = await Deno.fstat(file.rid);
assert(fileInfo.isFile);
assert(!fileInfo.isSymlink);
@@ -33,8 +31,6 @@ Deno.test({ permissions: { read: true } }, async function fstatSuccess() {
assert(fileInfo.mtime);
// The `birthtime` field is not available on Linux before kernel version 4.11.
assert(fileInfo.birthtime || Deno.build.os === "linux");
-
- Deno.close(file.rid);
});
Deno.test(