summaryrefslogtreecommitdiff
path: root/js/os_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/os_test.ts')
-rw-r--r--js/os_test.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/js/os_test.ts b/js/os_test.ts
index b2f511b5e..28c8b6a0b 100644
--- a/js/os_test.ts
+++ b/js/os_test.ts
@@ -56,9 +56,17 @@ testPerm({ env: false }, function homeDirPerm(): void {
});
testPerm({ env: true }, function execPath(): void {
- assertNotEquals(Deno.execPath, "");
+ assertNotEquals(Deno.execPath(), "");
});
testPerm({ env: false }, function execPathPerm(): void {
- assertEquals(Deno.execPath, "");
+ let caughtError = false;
+ try {
+ Deno.execPath();
+ } catch (err) {
+ caughtError = true;
+ assertEquals(err.kind, Deno.ErrorKind.PermissionDenied);
+ assertEquals(err.name, "PermissionDenied");
+ }
+ assert(caughtError);
});