From fb08cf7005c9dc781d51c7d02ae06060e44d32a3 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 24 Feb 2020 14:35:45 +0100 Subject: Add missing node os.release() implementation (#4065) --- cli/js/os_test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'cli/js/os_test.ts') 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); +}); -- cgit v1.2.3