diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index 5e28d6b944b6e0..4124a638a20234 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -53,6 +53,25 @@ function nextdir() { })); } +// fs.mkdir creates directory with mode passed as an options object +{ + const pathname = path.join(tmpdir.path, nextdir()); + + fs.mkdir(pathname, { mode: 0o777 }, common.mustCall(function(err) { + assert.strictEqual(err, null); + assert.strictEqual(fs.existsSync(pathname), true); + })); +} + +// fs.mkdirSync creates directory with mode passed as an options object +{ + const pathname = path.join(tmpdir.path, nextdir()); + + fs.mkdirSync(pathname, { mode: 0o777 }); + + assert.strictEqual(fs.existsSync(pathname), true); +} + // mkdirSync successfully creates directory from given path { const pathname = path.join(tmpdir.path, nextdir());