mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 12:49:10 +00:00
refactor: remove unneeded ErrorKinds (#3936)
This commit is contained in:
parent
d9efb8c02a
commit
dd8a109481
66 changed files with 553 additions and 620 deletions
|
@ -16,8 +16,7 @@ testPerm({ read: false }, function readFileSyncPerm(): void {
|
|||
Deno.readFileSync("cli/tests/fixture.json");
|
||||
} catch (e) {
|
||||
caughtError = true;
|
||||
assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
|
||||
assertEquals(e.name, "PermissionDenied");
|
||||
assert(e instanceof Deno.Err.PermissionDenied);
|
||||
}
|
||||
assert(caughtError);
|
||||
});
|
||||
|
@ -29,7 +28,7 @@ testPerm({ read: true }, function readFileSyncNotFound(): void {
|
|||
data = Deno.readFileSync("bad_filename");
|
||||
} catch (e) {
|
||||
caughtError = true;
|
||||
assertEquals(e.kind, Deno.ErrorKind.NotFound);
|
||||
assert(e instanceof Deno.Err.NotFound);
|
||||
}
|
||||
assert(caughtError);
|
||||
assert(data === undefined);
|
||||
|
@ -50,8 +49,7 @@ testPerm({ read: false }, async function readFilePerm(): Promise<void> {
|
|||
await Deno.readFile("cli/tests/fixture.json");
|
||||
} catch (e) {
|
||||
caughtError = true;
|
||||
assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
|
||||
assertEquals(e.name, "PermissionDenied");
|
||||
assert(e instanceof Deno.Err.PermissionDenied);
|
||||
}
|
||||
assert(caughtError);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue