Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where to put cypress tests: with front end code or own repo? [closed]

I am new to Cypress and trying to find the best practices for where to store our tests. I see there seems to be plenty of resources for how to organize folders to setup fixtures, tests, plugins, etc. but I can't seem to find any recommendations if people actually store the tests with the front-end code that's being tested or in it's own separate repo?

Are there any advantages of one or the other when trying to setup CICD?

like image 822
JD D Avatar asked Oct 25 '25 05:10

JD D


1 Answers

It is highly recommended to store tests within the same code base or repository as your application or front-end code for the following reasons:

  • Often new code changes need to be coupled with accompanying tests or pre-existing tests need to be updated to validate the new behavior or functionality.
  • It is important to see new code alongside related tests during the code review process.
  • Tests that run within the CI process after every commit or pull-request (PR) against your front-end can defend against merging in faulty or error-prone code. It is much easier to integrate CI within a PR workflow.

Tests living within the application repository is the most common pattern, but your ability have this implementation may vary based on your project, team/organization structure, or tech debt limitations.

like image 145
Amir Rustamzadeh Avatar answered Oct 27 '25 00:10

Amir Rustamzadeh