diff options
author | ecyrbe <ecyrbe@gmail.com> | 2020-02-24 14:35:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-24 08:35:45 -0500 |
commit | fb08cf7005c9dc781d51c7d02ae06060e44d32a3 (patch) | |
tree | 2a74abd57187a1b0015fd1d1873c10399e60fccd /cli/js/os_test.ts | |
parent | fe9ac35a650dfeea9168fc1cbbbf323b5689fc3b (diff) |
Add missing node os.release() implementation (#4065)
Diffstat (limited to 'cli/js/os_test.ts')
-rw-r--r-- | cli/js/os_test.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cli/js/os_test.ts b/cli/js/os_test.ts index 325cbdaa6..905a4efaf 100644 --- a/cli/js/os_test.ts +++ b/cli/js/os_test.ts @@ -315,3 +315,19 @@ testPerm({ env: false }, function hostnamePerm(): void { } assert(caughtError); }); + +testPerm({ env: true }, function releaseDir(): void { + assertNotEquals(Deno.osRelease(), ""); +}); + +testPerm({ env: false }, function releasePerm(): void { + let caughtError = false; + try { + Deno.osRelease(); + } catch (err) { + caughtError = true; + assert(err instanceof Deno.Err.PermissionDenied); + assertEquals(err.name, "PermissionDenied"); + } + assert(caughtError); +}); |