1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-25 16:49:18 -05:00
denoland-deno/std/node/_fs/_fs_mkdir_test.ts

33 lines
708 B
TypeScript
Raw Normal View History

// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { assert } from "../../testing/asserts.ts";
import { mkdir, mkdirSync } from "./_fs_mkdir.ts";
import { existsSync } from "./_fs_exists.ts";
const { test } = Deno;
const tmpDir = "./tmpdir";
test({
name: "[node/fs] mkdir",
fn: async () => {
const result = await new Promise((resolve) => {
mkdir(tmpDir, (err) => {
err && resolve(false);
resolve(existsSync(tmpDir));
Deno.removeSync(tmpDir);
});
});
assert(result);
},
});
test({
name: "[node/fs] mkdirSync",
fn: () => {
mkdirSync(tmpDir);
assert(existsSync(tmpDir));
Deno.removeSync(tmpDir);
},
});