Schema for internal use only

Please do not extend this schema as it is part of Nx internal usage.

@nx/angular:component-cypress-spec

Creates a Cypress spec for a UI component that has a story.

Examples

Create a cypress spec for a component that is set up with Storybook.

1nx g @nx/angular:component-cypress-spec --componentName=MyButtonComponent --componentPath=libs/ui/src/lib/button/button.component.ts --componentFileName=button.component --projectName=ui --projectPath=libs/ui 2

Usage

1nx generate component-cypress-spec ... 2

By default, Nx will search for component-cypress-spec in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

1nx g @nx/angular:component-cypress-spec ... 2

Show what will be generated without writing to disk:

1nx g component-cypress-spec ... --dry-run 2

Options

componentName

Required
string

Class name of the component.

componentPath

Required
string

Relative path to the component file from the project root.

componentFileName

Required
string

Component file name without the .ts extension.

projectName

Required
string

The name of the project.

projectPath

Required
string

Path to the project.

cypressProject

string

The Cypress project to generate the stories under. By default, inferred from projectName.

specDirectory

string

Directory where to place the generated spec file. By default matches the value of the componentPath option.

skipFormat

Internal
boolean
Default: false

Skip formatting files.