mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +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
|
@ -32,8 +32,7 @@ testPerm({ read: false }, function readDirSyncPerm(): void {
|
|||
Deno.readDirSync("tests/");
|
||||
} catch (e) {
|
||||
caughtError = true;
|
||||
assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
|
||||
assertEquals(e.name, "PermissionDenied");
|
||||
assert(e instanceof Deno.Err.PermissionDenied);
|
||||
}
|
||||
assert(caughtError);
|
||||
});
|
||||
|
@ -46,7 +45,7 @@ testPerm({ read: true }, function readDirSyncNotDir(): void {
|
|||
src = Deno.readDirSync("cli/tests/fixture.json");
|
||||
} catch (err) {
|
||||
caughtError = true;
|
||||
assertEquals(err.kind, Deno.ErrorKind.Other);
|
||||
assert(err instanceof Error);
|
||||
}
|
||||
assert(caughtError);
|
||||
assertEquals(src, undefined);
|
||||
|
@ -60,7 +59,7 @@ testPerm({ read: true }, function readDirSyncNotFound(): void {
|
|||
src = Deno.readDirSync("bad_dir_name");
|
||||
} catch (err) {
|
||||
caughtError = true;
|
||||
assertEquals(err.kind, Deno.ErrorKind.NotFound);
|
||||
assert(err instanceof Deno.Err.NotFound);
|
||||
}
|
||||
assert(caughtError);
|
||||
assertEquals(src, undefined);
|
||||
|
@ -77,8 +76,7 @@ testPerm({ read: false }, async function readDirPerm(): Promise<void> {
|
|||
await Deno.readDir("tests/");
|
||||
} 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