mysterious-pencil-77836
06/02/2022, 6:36 PM.
├── backend
│ ├── package.json
│ └── src
├── cypress
│ └── e2e
├── package.json
└── react
├── package.json
└── src
(where react
is a CRA app where my components live). Does this setup require any special setup for component testing?wonderful-match-15836
06/02/2022, 9:24 PMspecPattern
in the component
part of your config after setting up component testing, where you can use a glob to tell Cypress where to look for component specs. Which probably would be side by side with your react components in react/srcmysterious-pencil-77836
06/02/2022, 9:25 PMmysterious-pencil-77836
06/04/2022, 12:53 AMmysterious-pencil-77836
06/04/2022, 12:54 AMmysterious-pencil-77836
06/04/2022, 12:54 AMwonderful-match-15836
06/04/2022, 10:40 PMwonderful-match-15836
06/04/2022, 10:51 PMcypress open --global
). Since the component tests are probably only relevant to the react directory, and the specs are probably going to be right beside the components themselves, it might make sense to maintain the component testing stuff that way to.
A minimal way to set this up might be to open in global mode, then add the react
folder as a project. It'll walk you through setup and scaffold the bare minimum config for component testing, and it should find your dependencies since it will be looking in the right place. After that you, can see how you like what's generated and whether that approach is good for you.