MCPcopy Create free account
hub / github.com/denoland/std / assertDirectory

Function assertDirectory

fs/unstable_mkdir_test.ts:19–26  ·  view source on GitHub ↗
(path: string, expectMode?: number)

Source from the content-addressed store, hash-verified

17import { umask } from "node:process";
18
19function assertDirectory(path: string, expectMode?: number) {
20 const dirStat = lstatSync(path);
21 assert(dirStat.isDirectory());
22 if (platform() !== "win32" && expectMode !== undefined) {
23 assertExists(dirStat.mode);
24 assertEquals(dirStat.mode & 0o777, expectMode & ~umask(0o022));
25 }
26}
27
28Deno.test("mkdir() creates a directory with the default mode", async () => {
29 const tempDirPath = await makeTempDir({ prefix: "mkdir_" });

Callers 1

Calls 5

assertFunction · 0.90
assertExistsFunction · 0.90
assertEqualsFunction · 0.90
lstatSyncFunction · 0.85
umaskFunction · 0.85

Tested by

no test coverage detected