From: =?utf-8?q?Bastien_Roucari=C3=A8s?= <rouca@debian.org>
Date: Thu, 15 Aug 2024 00:03:25 +0000
Subject: Use modern mkdirp for fs-mkdirp-stream

Forwareded: not-needed
---
 fs-mkdirp-stream/index.js       |  11 +-
 fs-mkdirp-stream/mkdirp.js      | 143 ---------
 fs-mkdirp-stream/package.json   |   7 +-
 fs-mkdirp-stream/test/index.js  |  10 +-
 fs-mkdirp-stream/test/mkdirp.js | 627 ----------------------------------------
 5 files changed, 10 insertions(+), 788 deletions(-)
 delete mode 100644 fs-mkdirp-stream/mkdirp.js
 delete mode 100644 fs-mkdirp-stream/test/mkdirp.js

diff --git a/fs-mkdirp-stream/index.js b/fs-mkdirp-stream/index.js
index e69bba5..6672ade 100644
--- a/fs-mkdirp-stream/index.js
+++ b/fs-mkdirp-stream/index.js
@@ -1,8 +1,7 @@
 'use strict';
 
-var Transform = require('streamx').Transform;
-
-var mkdirp = require('./mkdirp');
+const { Transform } = require('node:stream')
+const { mkdirp } = require('mkdirp');
 
 function toFunction(dirpath) {
   function stringResolver(chunk, callback) {
@@ -19,7 +18,8 @@ function mkdirpStream(resolver) {
   }
 
   return new Transform({
-    transform: function (chunk, callback) {
+    objectMode: true,
+    transform: function (chunk, encoding, callback) {
       resolver(chunk, onDirpath);
 
       function onDirpath(dirpathErr, dirpath, mode) {
@@ -27,7 +27,8 @@ function mkdirpStream(resolver) {
           return callback(dirpathErr);
         }
 
-        mkdirp(dirpath, mode, onMkdirp);
+        mkdirp(dirpath, mode)
+          .then((token) => onMkdirp(null,token),(error) =>onMkdirp(error,null))
       }
 
       function onMkdirp(mkdirpErr) {
diff --git a/fs-mkdirp-stream/mkdirp.js b/fs-mkdirp-stream/mkdirp.js
deleted file mode 100644
index e620fce..0000000
--- a/fs-mkdirp-stream/mkdirp.js
+++ /dev/null
@@ -1,143 +0,0 @@
-'use strict';
-
-var path = require('path');
-
-var fs = require('graceful-fs');
-
-var MASK_MODE = parseInt('7777', 8);
-
-// Utility for passing dirpath that was used with `fs.stat`
-function stat(dirpath, cb) {
-  fs.stat(dirpath, onStat);
-
-  function onStat(err, stats) {
-    cb(err, dirpath, stats);
-  }
-}
-
-// Utility for passing dirpath that was used with `fs.lstat`
-function lstat(dirpath, cb) {
-  fs.lstat(dirpath, onStat);
-
-  function onStat(err, stats) {
-    cb(err, dirpath, stats);
-  }
-}
-
-function mkdirp(dirpath, mode, callback) {
-  if (typeof mode === 'function') {
-    callback = mode;
-    mode = undefined;
-  }
-
-  if (typeof mode === 'string') {
-    mode = parseInt(mode, 8);
-  }
-
-  dirpath = path.resolve(dirpath);
-
-  fs.mkdir(dirpath, mode, onMkdir);
-
-  function onMkdir(mkdirErr) {
-    if (!mkdirErr) {
-      return stat(dirpath, onStat);
-    }
-
-    switch (mkdirErr.code) {
-      case 'ENOENT': {
-        return mkdirp(path.dirname(dirpath), onRecurse);
-      }
-
-      case 'EEXIST': {
-        return stat(dirpath, onStat);
-      }
-
-      case 'ENOTDIR': {
-        // On ENOTDIR, this will traverse up the tree until it finds something it can stat
-        return stat(dirpath, onErrorRecurse);
-      }
-
-      default: {
-        return callback(mkdirErr);
-      }
-    }
-
-    function onErrorRecurse(err, dirpath, stats) {
-      if (err) {
-        return stat(path.dirname(dirpath), onErrorRecurse);
-      }
-
-      onStat(err, dirpath, stats);
-    }
-
-    function onStat(statErr, dirpath, stats) {
-      if (statErr) {
-        // If we have ENOENT here it might be a symlink,
-        // so we need to recurse to error with the target file name
-        if (statErr.code === 'ENOENT') {
-          return lstat(dirpath, onStat);
-        }
-
-        return callback(statErr);
-      }
-
-      if (!stats.isDirectory()) {
-        return lstat(dirpath, onNonDirectory);
-      }
-
-      if (!mode) {
-        return callback();
-      }
-
-      if ((stats.mode & MASK_MODE) === mode) {
-        return callback();
-      }
-
-      fs.chmod(dirpath, mode, onChmod);
-    }
-
-    function onChmod(chmodErr) {
-      if (chmodErr && chmodErr.code !== 'ENOSUP') {
-        return callback(chmodErr);
-      }
-
-      callback();
-    }
-
-    function onNonDirectory(err, dirpath, stats) {
-      if (err) {
-        // Just being cautious by bubbling the mkdir error
-        return callback(mkdirErr);
-      }
-
-      if (stats.isSymbolicLink()) {
-        return fs.readlink(dirpath, onReadlink);
-      }
-
-      // Trying to readdir will surface the ENOTDIR we want
-      // TODO: Use `opendir` when we support node >12
-      fs.readdir(dirpath, callback);
-    }
-
-    function onReadlink(err, link) {
-      if (err) {
-        // Just being cautious by bubbling the mkdir error
-        return callback(mkdirErr);
-      }
-
-      // Trying to readdir will surface the ENOTDIR we want
-      // TODO: Use `opendir` when we support node >12
-      fs.readdir(link, callback);
-    }
-  }
-
-  function onRecurse(recurseErr) {
-    if (recurseErr) {
-      return callback(recurseErr);
-    }
-
-    mkdirp(dirpath, mode, callback);
-  }
-}
-
-module.exports = mkdirp;
diff --git a/fs-mkdirp-stream/package.json b/fs-mkdirp-stream/package.json
index 08d7faa..9cfd18a 100644
--- a/fs-mkdirp-stream/package.json
+++ b/fs-mkdirp-stream/package.json
@@ -14,8 +14,7 @@
   "main": "index.js",
   "files": [
     "LICENSE",
-    "index.js",
-    "mkdirp.js"
+    "index.js"
   ],
   "scripts": {
     "lint": "eslint .",
@@ -23,8 +22,7 @@
     "test": "nyc mocha --async-only"
   },
   "dependencies": {
-    "graceful-fs": "^4.2.8",
-    "streamx": "^2.12.0"
+    "mkdirp": ">=2.1.0"
   },
   "devDependencies": {
     "eslint": "^7.32.0",
@@ -33,7 +31,6 @@
     "expect": "^27.4.2",
     "mocha": "^8.4.0",
     "nyc": "^15.1.0",
-    "readable-stream": "^3.6.0",
     "rimraf": "^3.0.2",
     "sinon": "^12.0.1"
   },
diff --git a/fs-mkdirp-stream/test/index.js b/fs-mkdirp-stream/test/index.js
index 162b2d3..7828955 100644
--- a/fs-mkdirp-stream/test/index.js
+++ b/fs-mkdirp-stream/test/index.js
@@ -5,7 +5,7 @@ var path = require('path');
 
 var fs = require('graceful-fs');
 var sinon = require('sinon');
-var expect = require('expect');
+var { expect } = require('expect');
 var rimraf = require('rimraf');
 
 var mkdirpStream = require('../');
@@ -182,10 +182,6 @@ function suite(moduleName) {
     });
 
     it('bubbles mkdir errors', function (done) {
-      sinon.stub(fs, 'mkdir').callsFake(function (dirpath, mode, cb) {
-        cb(new Error('boom'));
-      });
-
       function notExists() {
         statMode(outputDirpath);
       }
@@ -193,12 +189,11 @@ function suite(moduleName) {
       function assert(err) {
         expect(err).toBeDefined();
         expect(notExists).toThrow();
-        fs.mkdir.restore();
         done();
       }
 
       stream.pipeline(
-        [stream.Readable.from(['test']), mkdirpStream(outputDirpath), sink()],
+        [stream.Readable.from(['/nonexistant/']), mkdirpStream('/nonexistant/'), sink()],
         assert
       );
     });
@@ -206,5 +201,4 @@ function suite(moduleName) {
 }
 
 suite('stream');
-suite('streamx');
 suite('readable-stream');
diff --git a/fs-mkdirp-stream/test/mkdirp.js b/fs-mkdirp-stream/test/mkdirp.js
deleted file mode 100644
index d86d941..0000000
--- a/fs-mkdirp-stream/test/mkdirp.js
+++ /dev/null
@@ -1,627 +0,0 @@
-'use strict';
-
-var os = require('os');
-var path = require('path');
-
-var fs = require('graceful-fs');
-var sinon = require('sinon');
-var expect = require('expect');
-var rimraf = require('rimraf');
-
-var mkdirp = require('../mkdirp');
-
-var log = {
-  expected: function (expected) {
-    if (process.env.VERBOSE) {
-      console.log('Expected mode:', expected.toString(8));
-    }
-  },
-  found: function (found) {
-    if (process.env.VERBOSE) {
-      console.log('Found mode', found.toString(8));
-    }
-  },
-};
-
-function suite() {
-  var MASK_MODE = parseInt('7777', 8);
-  var DEFAULT_DIR_MODE = parseInt('0777', 8);
-  var isWindows = os.platform() === 'win32';
-
-  var outputBase = path.join(__dirname, './out-fixtures');
-  var outputDirpath = path.join(outputBase, './foo');
-  var outputNestedPath = path.join(outputDirpath, './test.txt');
-  var outputNestedDirpath = path.join(outputDirpath, './bar/baz/');
-  var contents = 'Hello World!\n';
-
-  function cleanup(done) {
-    this.timeout(20000);
-
-    // Async del to get sort-of-fix for https://github.com/isaacs/rimraf/issues/72
-    rimraf(outputBase, done);
-  }
-
-  function masked(mode) {
-    return mode & MASK_MODE;
-  }
-
-  function createdMode(outputPath) {
-    var mode = masked(fs.lstatSync(outputPath).mode);
-    log.found(mode);
-    return mode;
-  }
-
-  function expectedMode(mode) {
-    if (typeof mode !== 'number') {
-      mode = parseInt(mode, 8);
-    }
-
-    log.expected(mode);
-    return mode;
-  }
-
-  function expectedDefaultMode() {
-    // Set to use to "get" it
-    var current = process.umask(0);
-    // Then set it back for the next test
-    process.umask(current);
-
-    var mode = DEFAULT_DIR_MODE & ~current;
-    log.expected(mode);
-    return mode;
-  }
-
-  beforeEach(cleanup);
-  afterEach(cleanup);
-
-  beforeEach(function (done) {
-    fs.mkdir(outputBase, function (err) {
-      if (err) {
-        return done(err);
-      }
-
-      // Linux inherits the setgid of the directory and it messes up our assertions
-      // So we explixitly set the mode to 777 before each test
-      fs.chmod(outputBase, '777', done);
-    });
-  });
-
-  it('makes a single directory', function (done) {
-    mkdirp(outputDirpath, function (err) {
-      expect(err).toBeFalsy();
-      expect(createdMode(outputDirpath)).toBeDefined();
-
-      done();
-    });
-  });
-
-  it('makes single directory w/ default mode', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    mkdirp(outputDirpath, function (err) {
-      expect(err).toBeFalsy();
-      expect(createdMode(outputDirpath)).toEqual(expectedDefaultMode());
-
-      done();
-    });
-  });
-
-  it('makes multiple directories', function (done) {
-    mkdirp(outputNestedDirpath, function (err) {
-      expect(err).toBeFalsy();
-      expect(createdMode(outputNestedDirpath)).toBeDefined();
-
-      done();
-    });
-  });
-
-  it('makes multiple directories w/ default mode', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    mkdirp(outputNestedDirpath, function (err) {
-      expect(err).toBeFalsy();
-      expect(createdMode(outputNestedDirpath)).toEqual(expectedDefaultMode());
-
-      done();
-    });
-  });
-
-  it('makes directory with custom mode as string', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    var mode = '777';
-
-    mkdirp(outputDirpath, mode, function (err) {
-      expect(err).toBeFalsy();
-      expect(createdMode(outputDirpath)).toEqual(expectedMode(mode));
-
-      done();
-    });
-  });
-
-  it('makes directory with custom mode as octal', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    var mode = parseInt('777', 8);
-
-    mkdirp(outputDirpath, mode, function (err) {
-      expect(err).toBeFalsy();
-      expect(createdMode(outputDirpath)).toEqual(expectedMode(mode));
-
-      done();
-    });
-  });
-
-  it('does not mask a custom mode', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    var mode = parseInt('777', 8);
-
-    mkdirp(outputDirpath, mode, function (err) {
-      expect(err).toBeFalsy();
-      expect(createdMode(outputDirpath)).toEqual(mode);
-
-      done();
-    });
-  });
-
-  it('can create a directory with setgid permission', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    var mode = '2700';
-
-    mkdirp(outputDirpath, mode, function (err) {
-      expect(err).toBeFalsy();
-      expect(createdMode(outputDirpath)).toEqual(expectedMode(mode));
-
-      done();
-    });
-  });
-
-  it('does not change directory mode if exists and no mode given', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    var mode = '777';
-
-    mkdirp(outputDirpath, mode, function (err) {
-      expect(err).toBeFalsy();
-
-      mkdirp(outputDirpath, function (err2) {
-        expect(err2).toBeFalsy();
-        expect(createdMode(outputDirpath)).toEqual(expectedMode(mode));
-
-        done();
-      });
-    });
-  });
-
-  it('makes multiple directories with custom mode', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    var mode = '777';
-
-    mkdirp(outputNestedDirpath, mode, function (err) {
-      expect(err).toBeFalsy();
-      expect(createdMode(outputNestedDirpath)).toEqual(expectedMode(mode));
-
-      done();
-    });
-  });
-
-  it('uses default mode on intermediate directories', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    var intermediateDirpath = path.dirname(outputNestedDirpath);
-    var mode = '777';
-
-    mkdirp(outputNestedDirpath, mode, function (err) {
-      expect(err).toBeFalsy();
-      expect(createdMode(outputDirpath)).toEqual(expectedDefaultMode());
-      expect(createdMode(intermediateDirpath)).toEqual(expectedDefaultMode());
-      expect(createdMode(outputNestedDirpath)).toEqual(expectedMode(mode));
-
-      done();
-    });
-  });
-
-  it('changes mode of existing directory', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    var mode = '777';
-
-    fs.mkdir(outputDirpath, function (err) {
-      expect(err).toBeFalsy();
-      expect(createdMode(outputDirpath)).toEqual(expectedDefaultMode());
-
-      mkdirp(outputDirpath, mode, function (err2) {
-        expect(err2).toBeFalsy();
-        expect(createdMode(outputDirpath)).toEqual(expectedMode(mode));
-
-        done();
-      });
-    });
-  });
-
-  it('surfaces chmod errors', function (done) {
-    sinon.stub(fs, 'chmod').callsFake(function (p, mode, cb) {
-      cb(new Error('boom'));
-    });
-
-    var mode = '777';
-
-    mkdirp(outputDirpath, mode, function (err) {
-      fs.chmod.restore();
-
-      expect(err).toBeDefined();
-
-      done();
-    });
-  });
-
-  it('does not surface error ENOSUP if chmod is unsupported on the path', function (done) {
-    sinon.stub(fs, 'chmod').callsFake(function (p, mode, cb) {
-      var err = new Error('boom');
-      err.code = 'ENOSUP';
-      cb(err);
-    });
-
-    var mode = '777';
-
-    mkdirp(outputDirpath, mode, function (err) {
-      fs.chmod.restore();
-
-      expect(err).not.toBeDefined();
-
-      done();
-    });
-  });
-
-  it('errors with ENOTDIR if file in path', function (done) {
-    fs.mkdir(outputDirpath, function (err) {
-      expect(err).toBeFalsy();
-
-      fs.writeFile(outputNestedPath, contents, function (err2) {
-        expect(err2).toBeFalsy();
-
-        mkdirp(outputNestedPath, function (err3) {
-          expect(err3).toBeDefined();
-          expect(err3.code).toEqual('ENOTDIR');
-          expect(err3.path).toEqual(outputNestedPath);
-
-          done();
-        });
-      });
-    });
-  });
-
-  it('errors with ENOTDIR if file in path of nested mkdirp', function (done) {
-    var nestedPastFile = path.join(outputNestedPath, './bar/baz/');
-
-    fs.mkdir(outputDirpath, function (err) {
-      expect(err).toBeFalsy();
-
-      fs.writeFile(outputNestedPath, contents, function (err2) {
-        expect(err2).toBeFalsy();
-
-        mkdirp(nestedPastFile, function (err3) {
-          expect(err3).toBeDefined();
-          expect(err3.code).toEqual('ENOTDIR');
-          expect(err3.path).toEqual(outputNestedPath);
-
-          done();
-        });
-      });
-    });
-  });
-
-  it('does not change mode of existing file', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    var mode = '777';
-
-    fs.mkdir(outputDirpath, function (err) {
-      expect(err).toBeFalsy();
-
-      fs.writeFile(outputNestedPath, contents, function (err2) {
-        expect(err2).toBeFalsy();
-
-        var existingMode = createdMode(outputNestedPath);
-        expect(existingMode).not.toEqual(mode);
-
-        mkdirp(outputNestedPath, mode, function (err3) {
-          expect(err3).toBeDefined();
-          expect(createdMode(outputNestedPath)).toEqual(existingMode);
-
-          done();
-        });
-      });
-    });
-  });
-
-  it('surfaces mkdir errors that happening during recursion', function (done) {
-    var ogMkdir = fs.mkdir;
-
-    var stub = sinon.stub(fs, 'mkdir').callsFake(function (dirpath, mode, cb) {
-      if (stub.callCount === 1) {
-        return ogMkdir(dirpath, mode, cb);
-      }
-      cb(new Error('boom'));
-    });
-
-    mkdirp(outputNestedDirpath, function (err) {
-      fs.mkdir.restore();
-
-      expect(err).toBeDefined();
-
-      done();
-    });
-  });
-
-  it('surfaces fs.stat errors', function (done) {
-    sinon.stub(fs, 'stat').callsFake(function (dirpath, cb) {
-      cb(new Error('boom'));
-    });
-
-    mkdirp(outputDirpath, function (err) {
-      fs.stat.restore();
-
-      expect(err).toBeDefined();
-
-      done();
-    });
-  });
-
-  it('does not attempt fs.chmod if custom mode matches mode on disk', function (done) {
-    if (isWindows) {
-      this.skip();
-      return;
-    }
-
-    var mode = '777';
-
-    mkdirp(outputDirpath, mode, function (err) {
-      expect(err).toBeFalsy();
-
-      var spy = sinon.spy(fs, 'chmod');
-
-      mkdirp(outputDirpath, mode, function (err) {
-        fs.chmod.restore();
-
-        expect(err).toBeFalsy();
-        expect(spy.callCount).toEqual(0);
-
-        done();
-      });
-    });
-  });
-
-  describe('symlinks', function () {
-    before(function () {
-      if (isWindows) {
-        this.skip();
-        return;
-      }
-    });
-
-    it('succeeds with a directory at the target of a symlink', function (done) {
-      var target = path.join(outputBase, 'target');
-
-      fs.mkdir(target, function (err) {
-        expect(err).toBeFalsy();
-
-        fs.symlink(target, outputDirpath, function (err) {
-          expect(err).toBeFalsy();
-
-          mkdirp(outputDirpath, function (err) {
-            expect(err).toBeFalsy();
-            expect(createdMode(target)).toBeDefined();
-
-            done();
-          });
-        });
-      });
-    });
-
-    it('changes mode of existing directory at the target of a symlink', function (done) {
-      var target = path.join(outputBase, 'target');
-
-      var mode = '777';
-
-      fs.mkdir(target, function (err) {
-        expect(err).toBeFalsy();
-
-        fs.symlink(target, outputDirpath, function (err2) {
-          expect(err2).toBeFalsy();
-          expect(createdMode(target)).toEqual(expectedDefaultMode());
-
-          mkdirp(outputDirpath, mode, function (err3) {
-            expect(err3).toBeFalsy();
-            expect(createdMode(target)).toEqual(expectedMode(mode));
-            done();
-          });
-        });
-      });
-    });
-
-    it('creates nested directories at the target of a symlink', function (done) {
-      var target = path.join(outputBase, 'target');
-      var expected = path.join(target, './bar/baz/');
-
-      fs.mkdir(target, function (err) {
-        expect(err).toBeFalsy();
-
-        fs.symlink(target, outputDirpath, function (err2) {
-          expect(err2).toBeFalsy();
-
-          mkdirp(outputNestedDirpath, function (err3) {
-            expect(err3).toBeFalsy();
-            expect(createdMode(expected)).toBeDefined();
-            done();
-          });
-        });
-      });
-    });
-
-    it('errors with ENOTDIR if the target of a symlink is a file', function (done) {
-      var target = path.join(outputBase, 'test.txt');
-
-      fs.mkdir(outputDirpath, function (err) {
-        expect(err).toBeFalsy();
-
-        fs.writeFile(target, contents, function (err2) {
-          expect(err2).toBeFalsy();
-
-          fs.symlink(target, outputNestedPath, function (err3) {
-            expect(err3).toBeFalsy();
-
-            mkdirp(outputNestedPath, function (err4) {
-              expect(err4).toBeDefined();
-              expect(err4.code).toEqual('ENOTDIR');
-              expect(err4.path).toEqual(target);
-              done();
-            });
-          });
-        });
-      });
-    });
-
-    it('errors with ENOTDIR if the target of a symlink is a file in a nested mkdirp', function (done) {
-      var target = path.join(outputBase, 'test.txt');
-
-      fs.writeFile(target, contents, function (err) {
-        expect(err).toBeFalsy();
-
-        fs.symlink(target, outputDirpath, function (err2) {
-          expect(err2).toBeFalsy();
-
-          mkdirp(outputNestedDirpath, function (err3) {
-            expect(err3).toBeDefined();
-            expect(err3.code).toEqual('ENOTDIR');
-            expect(err3.path).toEqual(target);
-            done();
-          });
-        });
-      });
-    });
-
-    it('errors with ENOENT if the target of a symlink is missing (a.k.a. dangling symlink)', function (done) {
-      var target = path.join(outputBase, 'dangling-link');
-
-      fs.symlink(target, outputDirpath, function (err) {
-        expect(err).toBeFalsy();
-
-        mkdirp(outputDirpath, function (err2) {
-          expect(err2).toBeDefined();
-          expect(err2.code).toEqual('ENOENT');
-          expect(err2.path).toEqual(target);
-          done();
-        });
-      });
-    });
-
-    it('properly surfaces top-level error if lstat fails', function (done) {
-      var target = path.join(outputBase, 'test.txt');
-
-      sinon.stub(fs, 'lstat').callsFake(function (dirpath, cb) {
-        cb(new Error('boom'));
-      });
-
-      fs.mkdir(outputDirpath, function (err) {
-        expect(err).toBeFalsy();
-
-        fs.writeFile(target, contents, function (err2) {
-          expect(err2).toBeFalsy();
-
-          fs.symlink(target, outputNestedPath, function (err3) {
-            expect(err3).toBeFalsy();
-
-            mkdirp(outputNestedPath, function (err4) {
-              fs.lstat.restore();
-
-              expect(err4).toBeDefined();
-              expect(err4.code).toEqual('EEXIST');
-              expect(err4.path).toEqual(outputNestedPath);
-
-              done();
-            });
-          });
-        });
-      });
-    });
-
-    it('properly surfaces top-level error if readlink fails', function (done) {
-      var target = path.join(outputBase, 'target');
-
-      sinon.stub(fs, 'readlink').callsFake(function (dirpath, cb) {
-        cb(new Error('boom'));
-      });
-
-      fs.symlink(target, outputDirpath, function (err) {
-        expect(err).toBeFalsy();
-
-        mkdirp(outputDirpath, function (err2) {
-          fs.readlink.restore();
-
-          expect(err2).toBeDefined();
-          expect(err2.code).toEqual('EEXIST');
-          expect(err2.path).toEqual(outputDirpath);
-
-          done();
-        });
-      });
-    });
-  });
-}
-
-describe('mkdirp', suite);
-
-describe('mkdirp with umask', function () {
-  var startingUmask;
-  before(function (done) {
-    startingUmask = process.umask(parseInt('066', 8));
-
-    done();
-  });
-
-  after(function (done) {
-    process.umask(startingUmask);
-
-    done();
-  });
-
-  // Initialize the normal suite
-  suite();
-});
