-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add option to run specs outside of cypress directory #1012
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Cypress is specialized for e2e and integration tests. While you can do unit tests, it's not really our thing. Globbing support is already on the roadmap here. #681 I'm going to mark this issue as wontfix but we'll keep it around when we come back to first class unit testing support. |
@brian-mann Okay, thanks for the explanation! |
@brian-mann I dont' get this |
Ok I solved this. I found that it is still unclear because probably lack of documentation. |
For my use case i needed
in my cypress.json config and it worked a charm. I want to run integration tests from the cypress directory. But then place cypress unit tests next to the specific code file i am unit testing. |
Is this a Feature or Bug?
Feature
Current behavior:
Cypress only runs spec files within the directory
cypress/integration
.Desired behavior:
The option to run files that match a certain glob, e.g.
*.spec.js
, outside of thecypress/integration
directory.Reasoning:
It's really nice to be able to place unit tests in the same directory as the module they are testing. When a new developer dives into a code base that colocates modules and their unit tests, they don't have to go searching for the tests in another directory.
Here's an article about the advantages of colocating unit tests: http://islovely.co/posts/colocating-unit-tests/
I couldn't find any documentation related to this feature, so I'm wondering: is this already possible? If not, could we add this feature?
The text was updated successfully, but these errors were encountered: