summaryrefslogtreecommitdiff
path: root/cli/js/os_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/os_test.ts')
-rw-r--r--cli/js/os_test.ts16
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);
+});