summaryrefslogtreecommitdiff
path: root/cli/tests/unit/os_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/os_test.ts')
-rw-r--r--cli/tests/unit/os_test.ts16
1 files changed, 7 insertions, 9 deletions
diff --git a/cli/tests/unit/os_test.ts b/cli/tests/unit/os_test.ts
index e99002534..72c88b0e1 100644
--- a/cli/tests/unit/os_test.ts
+++ b/cli/tests/unit/os_test.ts
@@ -277,15 +277,13 @@ unitTest({ perms: { read: true } }, function execPath(): void {
});
unitTest({ perms: { read: false } }, function execPathPerm(): void {
- let caughtError = false;
- try {
- Deno.execPath();
- } catch (err) {
- caughtError = true;
- assert(err instanceof Deno.errors.PermissionDenied);
- assertEquals(err.name, "PermissionDenied");
- }
- assert(caughtError);
+ assertThrows(
+ () => {
+ Deno.execPath();
+ },
+ Deno.errors.PermissionDenied,
+ "read access to <exec_path>, run again with the --allow-read flag"
+ );
});
unitTest({ perms: { env: true } }, function loadavgSuccess(): void {