summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2020-06-12 12:25:07 +0000
committerGitHub <noreply@github.com>2020-06-12 14:25:07 +0200
commit928522145226cb34069b6561d0b10cfd6ce01e5d (patch)
tree0b606a5c0c5ceb3352892c4961eb958bbd416c23
parente7054d50f0992103a8810bb012179235fb30e0fe (diff)
fix(cli/js): broken truncate permission tests (#6249)
The tests for testing that `Deno.truncateSync` and `Deno.truncate` require write permissions seem to not call the functions they are testing *at all* and are calling `Deno.mkdir` and `Deno.mkdirSync` instead. This commit replaces those calls with calls to `Deno.truncateSync` and `Deno.truncate` respectively.
-rw-r--r--cli/tests/unit/truncate_test.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/tests/unit/truncate_test.ts b/cli/tests/unit/truncate_test.ts
index 3fd85c990..b9e3a341c 100644
--- a/cli/tests/unit/truncate_test.ts
+++ b/cli/tests/unit/truncate_test.ts
@@ -58,7 +58,7 @@ unitTest(
unitTest({ perms: { write: false } }, function truncateSyncPerm(): void {
let err;
try {
- Deno.mkdirSync("/test_truncateSyncPermission.txt");
+ Deno.truncateSync("/test_truncateSyncPermission.txt");
} catch (e) {
err = e;
}
@@ -71,7 +71,7 @@ unitTest({ perms: { write: false } }, async function truncatePerm(): Promise<
> {
let err;
try {
- await Deno.mkdir("/test_truncatePermission.txt");
+ await Deno.truncate("/test_truncatePermission.txt");
} catch (e) {
err = e;
}