affected = function (option, grunt) {
  var done = this.async();

  affectedSpecs = [
    './lib/assets/javascripts/builder/components/form-components/index.js',
    './lib/assets/test/spec/builder/components/modals/add-analysis/analysis-options.spec.js',
    './lib/assets/test/spec/builder/routes/router.spec.js'
  ];

  let allSpecs = glob.sync(paths.builder_specs).concat(glob.sync(paths.deep_insights_specs));
  const match = grunt.option('match');

  if (match) {
    allSpecs = filterSpecs(allSpecs, match);
  }

  console.log(colors.yellow('All specs. ' + allSpecs.length + ' specs found.'));

  affectedSpecs = affectedSpecs.concat(allSpecs);
  affectedSpecs = _.uniq(affectedSpecs);

  done();
}
/*.spec.js'
};

// Filter a list of files with a string
// the string will be converted to a RegExp
function filterSpecs (affectedSpecs, match) {
  const re = new RegExp(match);
  return affectedSpecs.filter(specFile => {
    const fileName = specFile.split(/spec\//)[1];
    return re.test(fileName);
  });
}

/**
affected - To be used as part of a 'registerTask' Grunt definition