@nx/react:component-cypress-spec

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

Usage

nx generate component-cypress-spec ...

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:

nx g @nx/react:component-cypress-spec ...
Nx 15 and lower use @nrwl/ instead of @nx/

Show what will be generated without writing to disk:

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

Options

componentPath

Required
string

Relative path to the component file from the library root?

project

Required
string

The project name for which to generate tests.

cypressProject

string

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

js

boolean
Default: false

Generate JavaScript files rather than TypeScript files.

skipFormat

boolean
Default: false

Skip formatting files.