https://cypress.io logo
What is the best place to put test specs? Is it ok...
# i-need-help
c
We have a mono repo React application and currently we are planning to write e2e tests using cypress. There is a discussion about where to put the test spec files and one of the suggestions is implement them on the src>apps folder. I believe it is not a good idea and it is better to separate them to cypress folder. But is there any idea/thoughts regarding this?
e
Cypress automatically scaffolds a suggested folder structure separately in a
cypress/e2e
folder. I personally agree with this structuring and haven't found any positives in having e2e tests live with the app code. If the code is purely for testing, I don't see any benefit in including it in the app folder. To me, that just introduces unnecessary confusion and configuration within the app code. That being said, I would argue that Cypress component test files should live as a sibling with the component app code itself, similarly to other jest or unit test structures.
c
Okay, thank you for your reply!