File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 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-
52import {
63 assert ,
74 assertEquals ,
@@ -159,9 +156,23 @@ Deno.test(
159156) ;
160157
161158Deno . 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) ;
You can’t perform that action at this time.
0 commit comments