diff --git a/test/utils.js b/test/utils.js index 5596b38668..0bf10b18ea 100644 --- a/test/utils.js +++ b/test/utils.js @@ -38,8 +38,8 @@ var mapOr = function(func, array, done) { // Make a directory and sub-directories. var mkPath = function(dirPath, mode, done) { fs.mkdir(dirPath, typeof mode === "string" ? parseInt(mode, 8) : mode, function (e) { - if (e && e.code === "EEXIST") { - // Already exists, done. + if (!e || e.code === "EEXIST") { + // Created or already exists, done. done(); } else if (e.code === "ENOENT") {