__mocks__/fs-extra-promise.js
function copyDirSync(src, dest) {
  if (fs.lstatSync(src).isDirectory()) {
    const files = fs.readdirSync(src);
    files.forEach((file) => {
      const curSource = path.join(src, file);
      const curDest = path.join(dest, file);
      if (fs.lstatSync(curSource).isDirectory()) {
        if (!fs.existsSync(curDest)) {
          createDir(curDest);
        }
        copyDirSync(curSource, curDest);
      } else {
        copyFileSync(curSource, curDest);
      }
    });
  }
}
function copyDirSync(src, dest) {
  if (fs.lstatSync(src).isDirectory()) {
    const files = fs.readdirSync(src);
    files.forEach((file) => {
      const curSource = path.join(src, file);
      const curDest = path.join(dest, file);
      if (fs.lstatSync(curSource).isDirectory()) {
        if (!fs.existsSync(curDest)) {
          createDir(curDest);
        }
        copyDirSync(curSource, curDest);
      } else {
        copyFileSync(curSource, curDest);
      }
    });
  }
}
function copyDirSync ( src , dest ) { if ( fs . lstatSync ( src ) . isDirectory ( ) ) { const files = fs . readdirSync ( src ) ; files . forEach ( ( file ) => { const curSource = path . join ( src , file ) ; const curDest = path . join ( dest , file ) ; if ( fs . lstatSync ( curSource ) . isDirectory ( ) ) { if ( ! fs . existsSync ( curDest ) ) { createDir ( curDest ) ; } copyDirSync ( curSource , curDest ) ; } else { copyFileSync ( curSource , curDest ) ; } } ) ; } }
Utility function to copy a directory to a destination recursively
Utility function to copy a directory to a destination recursively