@nrwl/react:component-test

Add a Cypress component test for a component.

Usage

nx generate component-test ...

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

You can specify the collection explicitly as follows:

nx g @nrwl/react:component-test ...

Show what will be generated without writing to disk:

nx g component-test ... --dry-run

Examples

Create a cypress component test for FancyComponent:

nx g @nrwl/react:component-test --project=my-react-project --component-path=src/lib/fancy-component.tsx

Options

componentPath

Required
string

Path to component, from the project source root

project

Required
string

The name of the project the component is apart of