Skip to content

Commit

Permalink
clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 22, 2022
1 parent c905d65 commit 2a28125
Show file tree
Hide file tree
Showing 15 changed files with 5,136 additions and 5,616 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function mkdirP (p, opts, f, made) {
}
if (!made) made = null;

var cb = f || function () {};
var cb = f || /* istanbul ignore next */ function () {};
p = path.resolve(p);

xfs.mkdir(p, mode, function (er) {
Expand All @@ -31,8 +31,10 @@ function mkdirP (p, opts, f, made) {
}
switch (er.code) {
case 'ENOENT':
/* istanbul ignore if */
if (path.dirname(p) === p) return cb(er);
mkdirP(path.dirname(p), opts, function (er, made) {
/* istanbul ignore if */
if (er) cb(er, made);
else mkdirP(p, opts, cb, made);
});
Expand Down Expand Up @@ -87,9 +89,10 @@ mkdirP.sync = function sync (p, opts, made) {
try {
stat = xfs.statSync(p);
}
catch (err1) {
catch (err1) /* istanbul ignore next */ {
throw err0;
}
/* istanbul ignore if */
if (!stat.isDirectory()) throw err0;
break;
}
Expand Down

0 comments on commit 2a28125

Please sign in to comment.