mirror of
https://github.com/denoland/deno.git
synced 2025-09-20 17:39:51 +00:00
fix: Deno.mkdir should conform to style guide (#3617)
This commit is contained in:
parent
ad9fd589d4
commit
d4bf0670ce
12 changed files with 87 additions and 39 deletions
|
@ -10,7 +10,7 @@ testPerm({ read: true, write: true }, function mkdirSyncSuccess(): void {
|
|||
|
||||
testPerm({ read: true, write: true }, function mkdirSyncMode(): void {
|
||||
const path = Deno.makeTempDirSync() + "/dir";
|
||||
Deno.mkdirSync(path, false, 0o755); // no perm for x
|
||||
Deno.mkdirSync(path, { mode: 0o755 }); // no perm for x
|
||||
const pathInfo = Deno.statSync(path);
|
||||
if (pathInfo.mode !== null) {
|
||||
// Skip windows
|
||||
|
@ -51,7 +51,7 @@ testPerm({ write: true }, function mkdirErrIfExists(): void {
|
|||
|
||||
testPerm({ read: true, write: true }, function mkdirSyncRecursive(): void {
|
||||
const path = Deno.makeTempDirSync() + "/nested/directory";
|
||||
Deno.mkdirSync(path, true);
|
||||
Deno.mkdirSync(path, { recursive: true });
|
||||
const pathInfo = Deno.statSync(path);
|
||||
assert(pathInfo.isDirectory());
|
||||
});
|
||||
|
@ -60,7 +60,7 @@ testPerm({ read: true, write: true }, async function mkdirRecursive(): Promise<
|
|||
void
|
||||
> {
|
||||
const path = Deno.makeTempDirSync() + "/nested/directory";
|
||||
await Deno.mkdir(path, true);
|
||||
await Deno.mkdir(path, { recursive: true });
|
||||
const pathInfo = Deno.statSync(path);
|
||||
assert(pathInfo.isDirectory());
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue