/** * Finds all empty directories within `options.cwd`. * @private * @param {Function} cb Callback to call once complete. */ _findEmptyDirs(cb) { let self = this, results = []; subdirs(this.options.cwd, function(err, dirs) { if(err) self.utils.error(err, '_findEmptyDirs'); if(err || !Array.isArray(dirs)) return cb(err, []); each(dirs, (dir, dCb) => { emptyDir(dir, self.options.emptyDirFilter || function() { return true; }, (err, isEmpty) => { if(err) self.utils.error(err, '_findEmptyDirs'); if(err || !isEmpty) return dCb(); results.push(dir); dCb(); }); }, (err) => { self.emit('emptyDirs', results); cb(err, results); }); }); }
mkdirp(fixturePath) if (emptyDir(fixturePath)) { throw String(`Please put some files to the ${fixturePath} directory, you might not want to test with no files right?`)