import { externalSchematic, noop, Rule } from '@angular-devkit/schematics';
import { NormalizedSchema } from './normalize-options';

export function addCypress(options: NormalizedSchema): Rule {
  return options.e2eTestRunner === 'cypress'
    ? externalSchematic('@nrwl/cypress', 'cypress-project', {
        ...options,
        name: options.name + '-e2e',
        directory: options.directory,
        project: options.projectName,
      })
    : noop();
}
