mirror of
https://github.com/denoland/deno.git
synced 2024-11-23 15:16:54 -05:00
32 lines
708 B
TypeScript
32 lines
708 B
TypeScript
// 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);
|
|
},
|
|
});
|