mirror of
https://github.com/denoland/deno.git
synced 2024-12-17 21:03:01 -05:00
29 lines
693 B
TypeScript
29 lines
693 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 tmpDir = "./tmpdir";
|
|
|
|
Deno.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);
|
|
},
|
|
});
|
|
|
|
Deno.test({
|
|
name: "[node/fs] mkdirSync",
|
|
fn: () => {
|
|
mkdirSync(tmpDir);
|
|
assert(existsSync(tmpDir));
|
|
Deno.removeSync(tmpDir);
|
|
},
|
|
});
|