0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

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.
This commit is contained in:
Casper Beyer 2020-06-12 12:25:07 +00:00 committed by GitHub
parent e7054d50f0
commit 9285221452
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}