Skip to content

Commit ec034a5

Browse files
committed
revert: remove changes to read_file_test.ts
Keep PR focused only on type definitions. The read_file_test.ts changes were testing runtime behavior that doesn't exist yet.
1 parent b1662ad commit ec034a5

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

tests/unit/read_file_test.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
// Copyright 2018-2025 the Deno authors. MIT license.
2-
/// <reference path="../../cli/tsc/dts/lib.dom.d.ts" />
3-
/// <reference path="../../cli/tsc/dts/lib.deno.ns.d.ts" />
4-
52
import {
63
assert,
74
assertEquals,
@@ -159,9 +156,23 @@ Deno.test(
159156
);
160157

161158
Deno.test(
162-
{ ignore: Deno.build.os !== "linux" },
163-
async function readFileProcFs() {
164-
const data = await Deno.readFile("/proc/self/stat");
165-
assert(data.byteLength > 0);
159+
{ permissions: { read: true } },
160+
async function readFileNotFoundErrorCode() {
161+
try {
162+
await Deno.readFile("definitely-not-found.json");
163+
} catch (e) {
164+
assertEquals((e as { code: string }).code, "ENOENT");
165+
}
166+
},
167+
);
168+
169+
Deno.test(
170+
{ permissions: { read: true } },
171+
async function readFileIsDirectoryErrorCode() {
172+
try {
173+
await Deno.readFile("tests/testdata/assets/");
174+
} catch (e) {
175+
assertEquals((e as { code: string }).code, "EISDIR");
176+
}
166177
},
167178
);

0 commit comments

Comments
 (0)