__mocks__/fs-extra-promise.js
function rimraf(dirPath) {
  if (fs.existsSync(dirPath)) {
    fs.readdirSync(dirPath).forEach((entry) => {
      const entryPath = path.join(dirPath, entry);
      if (fs.lstatSync(entryPath).isDirectory()) {
        rimraf(entryPath);
      } else {
        fs.unlinkSync(entryPath);
      }
    });
    fs.rmdirSync(dirPath);
  }
}
function rimraf(dirPath) {
  if (fs.existsSync(dirPath)) {
    fs.readdirSync(dirPath).forEach((entry) => {
      const entryPath = path.join(dirPath, entry);
      if (fs.lstatSync(entryPath).isDirectory()) {
        rimraf(entryPath);
      } else {
        fs.unlinkSync(entryPath);
      }
    });
    fs.rmdirSync(dirPath);
  }
}
function rimraf ( dirPath ) { if ( fs . existsSync ( dirPath ) ) { fs . readdirSync ( dirPath ) . forEach ( ( entry ) => { const entryPath = path . join ( dirPath , entry ) ; if ( fs . lstatSync ( entryPath ) . isDirectory ( ) ) { rimraf ( entryPath ) ; } else { fs . unlinkSync ( entryPath ) ; } } ) ; fs . rmdirSync ( dirPath ) ; } }
Utils
 
Remove directory recursively
@param {string} dirPath
@see https://stackoverflow.com/a/42505874/3027390
Utils Remove directory recursively