pathsToTest.forEach(pathToTest => { var messageValue = { message: 'Warning: the file you asked to watch does not exist...', value: pathToTest + hintStr }; q.defer(validatePath(messageValue), pathToTest); });
/* -------------------------------------------- * Check that our taskFiles exist */ watchGroup.events.forEach(evt => { if (evt.taskFiles) { let taskFiles = _.isArray(evt.taskFiles) ? evt.taskFiles : [evt.taskFiles]; taskFiles.forEach(pathToTest => { var messageValue = { message: `Error: Task file for \`${watchGroup.serviceName}\` service's \`${evt.type}\` event does not exist.`, value: pathToTest }; q.defer(validatePath(messageValue), pathToTest); }); } });
function add (watchGroups, onDone, testsCb) { if (!_.isArray(watchGroups)) { watchGroups = [watchGroups]; } onDone = onDone || identity; // Add this hook for testing testsCb = _.defaults({}, testsCb || {}, { onInit: identity, onEvent: identity, onCommandEvent: identity, onTaskFileEvent: identity }); var q = queue(); // Loop through each file directive watchGroups.forEach(function (watchGroup) { q.defer(processWatchGroup(testsCb), watchGroup); }); q.awaitAll(function (err, onDones) { onDone(err, onDones); }); }