summaryrefslogtreecommitdiff
path: root/cli/js/read_dir_test.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-02-21 10:36:13 -0500
committerGitHub <noreply@github.com>2020-02-21 10:36:13 -0500
commitdd8a10948195f231a6a9eb652e3f208813904ad6 (patch)
treef9a4afeb67bbead882c29c2458a5f1f99e2e42db /cli/js/read_dir_test.ts
parentd9efb8c02a0036d755c35e8e9c88d58bd45a9e2b (diff)
refactor: remove unneeded ErrorKinds (#3936)
Diffstat (limited to 'cli/js/read_dir_test.ts')
-rw-r--r--cli/js/read_dir_test.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/cli/js/read_dir_test.ts b/cli/js/read_dir_test.ts
index 77d2cbfe2..4496d7447 100644
--- a/cli/js/read_dir_test.ts
+++ b/cli/js/read_dir_test.ts
@@ -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);
});