summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-mkdir.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-fs-mkdir.js')
-rw-r--r--test/parallel/test-fs-mkdir.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js
index 54585a3f12..7cfb09295e 100644
--- a/test/parallel/test-fs-mkdir.js
+++ b/test/parallel/test-fs-mkdir.js
@@ -53,6 +53,23 @@ common.refreshTmpDir();
assert.strictEqual(exists, true);
}
+[false, 1, {}, [], null, undefined].forEach((i) => {
+ common.expectsError(
+ () => fs.mkdir(i, common.mustNotCall()),
+ {
+ code: 'ERR_INVALID_ARG_TYPE',
+ type: TypeError
+ }
+ );
+ common.expectsError(
+ () => fs.mkdirSync(i),
+ {
+ code: 'ERR_INVALID_ARG_TYPE',
+ type: TypeError
+ }
+ );
+});
+
// Keep the event loop alive so the async mkdir() requests
// have a chance to run (since they don't ref the event loop).
process.nextTick(() => {});