MCPcopy Index your code
hub / github.com/nodejs/node / test

Function test

test/parallel/test-fs-mkdir-mode-mask.js:20–37  ·  view source on GitHub ↗
(mode, asString)

Source from the content-addressed store, hash-verified

18tmpdir.refresh();
19
20function test(mode, asString) {
21 const suffix = asString ? 'str' : 'num';
22 const input = asString ?
23 (mode | maskToIgnore).toString(8) : (mode | maskToIgnore);
24
25 {
26 const dir = tmpdir.resolve(`mkdirSync-${suffix}`);
27 fs.mkdirSync(dir, input);
28 assert.strictEqual(fs.statSync(dir).mode & 0o777, mode);
29 }
30
31 {
32 const dir = tmpdir.resolve(`mkdir-${suffix}`);
33 fs.mkdir(dir, input, common.mustSucceed(() => {
34 assert.strictEqual(fs.statSync(dir).mode & 0o777, mode);
35 }));
36 }
37}
38
39test(mode, true);
40test(mode, false);

Callers 1

Calls 5

toStringMethod · 0.45
resolveMethod · 0.45
mkdirSyncMethod · 0.45
statSyncMethod · 0.45
mkdirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…