This example was built as follows:
-
Vite > Getting Started instructions with the react template were used to create the app
npm create vite@latest component-tests -- --template react
The linting
npmmodules and linting script have been removed, since this is out-of-scope for the example. -
The Cypress documentation instructions from Component Testing > Getting Started were followed to set up component testing, including copying
<Stepper />component: react/my-awesome-app/src/components/Stepper.jsx
from the Cypress Component Testing Quickstart Apps repo to this repo's
examples/component-tests/src/components/sub-directory. -
The script
"test": "cypress run --component"was added topackage.json.
Execute the following to change to this directory:
cd examples/component-testsInstall dependencies with:
npm ciRun Cypress component testing with:
npm test