summaryrefslogtreecommitdiff
path: root/cli/js/read_dir_test.ts
diff options
context:
space:
mode:
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);
});