summaryrefslogtreecommitdiff
path: root/js/os_test.ts
diff options
context:
space:
mode:
authorKevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com>2019-08-06 14:05:47 -0700
committerRyan Dahl <ry@tinyclouds.org>2019-08-06 17:05:47 -0400
commit4519f9a50db8852c5b70ff47481f0fc9d0fbe2f2 (patch)
treec56ebee9b57aa77df16f656e8f3ad50c65a9e2a9 /js/os_test.ts
parentccee2f01ba2f6304720ab17e99dee17bf6687bd8 (diff)
Make Deno.execPath a function (#2743)
And throws without allow-env
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);
});