diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-09-23 07:50:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-23 01:50:50 +0200 |
commit | 830586d242216e64fcd16e65cc83db9d54d63dc0 (patch) | |
tree | a84f0090faaa14879693016e9d9b13fcfbb92dcd /cli/tests/unit/truncate_test.ts | |
parent | 87e78802b0ae65cc57d66eaa8e5265f74cf69092 (diff) |
test(cli): align unit test permissions with runtime test permissions (#12189)
Diffstat (limited to 'cli/tests/unit/truncate_test.ts')
-rw-r--r-- | cli/tests/unit/truncate_test.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cli/tests/unit/truncate_test.ts b/cli/tests/unit/truncate_test.ts index 89ca12634..19a44dba9 100644 --- a/cli/tests/unit/truncate_test.ts +++ b/cli/tests/unit/truncate_test.ts @@ -7,7 +7,7 @@ import { } from "./test_util.ts"; unitTest( - { perms: { read: true, write: true } }, + { permissions: { read: true, write: true } }, function ftruncateSyncSuccess() { const filename = Deno.makeTempDirSync() + "/test_ftruncateSync.txt"; const file = Deno.openSync(filename, { @@ -29,7 +29,7 @@ unitTest( ); unitTest( - { perms: { read: true, write: true } }, + { permissions: { read: true, write: true } }, async function ftruncateSuccess() { const filename = Deno.makeTempDirSync() + "/test_ftruncate.txt"; const file = await Deno.open(filename, { @@ -51,7 +51,7 @@ unitTest( ); unitTest( - { perms: { read: true, write: true } }, + { permissions: { read: true, write: true } }, function truncateSyncSuccess() { const filename = Deno.makeTempDirSync() + "/test_truncateSync.txt"; Deno.writeFileSync(filename, new Uint8Array(5)); @@ -66,7 +66,7 @@ unitTest( ); unitTest( - { perms: { read: true, write: true } }, + { permissions: { read: true, write: true } }, async function truncateSuccess() { const filename = Deno.makeTempDirSync() + "/test_truncate.txt"; await Deno.writeFile(filename, new Uint8Array(5)); @@ -80,13 +80,13 @@ unitTest( }, ); -unitTest({ perms: { write: false } }, function truncateSyncPerm() { +unitTest({ permissions: { write: false } }, function truncateSyncPerm() { assertThrows(() => { Deno.truncateSync("/test_truncateSyncPermission.txt"); }, Deno.errors.PermissionDenied); }); -unitTest({ perms: { write: false } }, async function truncatePerm() { +unitTest({ permissions: { write: false } }, async function truncatePerm() { await assertRejects(async () => { await Deno.truncate("/test_truncatePermission.txt"); }, Deno.errors.PermissionDenied); |