diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2019-08-06 14:05:47 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-08-06 17:05:47 -0400 |
commit | 4519f9a50db8852c5b70ff47481f0fc9d0fbe2f2 (patch) | |
tree | c56ebee9b57aa77df16f656e8f3ad50c65a9e2a9 /js/os_test.ts | |
parent | ccee2f01ba2f6304720ab17e99dee17bf6687bd8 (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.ts | 12 |
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); }); |