Cypress: Cypress auto-generates files too aggressively

Created on 16 May 2017  路  5Comments  路  Source: cypress-io/cypress

  • Operating System: MacOS
  • Cypress Version: 0.19.2

Are you requesting a feature or reporting a bug?

Feature (usability)

Current behavior:

Cypress generates a fixture example on every run if there is no cypress/fixtures directory. A project with existing Cypress tests but no fixtures (an empty cypress/fixtures directory) will trigger this behavior for every next developer who clones it, as the empty directory isn't known to git. Whoops, that's confusing to collaborators!

Expected behavior:

I expect Cypress not to generate any files on my behalf for a project that has already had Cypress set up by my team. This might mean:

  • only generating files at the time Cypress is first added
  • a setting for disabling this behavior on the project
  • extra setup information about using .keep files in the cypress/fixtures directory

How to reproduce the current behavior:

Delete the cypress/fixtures folder and run the tests.

Test code:

N/A

Additional Info (images, notes, stack traces, etc)

I assume this happens for other auto-generated files as well, I just happened to run into it with the fixtures directory.

duplicate

Most helpful comment

Also applies to the cypress/support folder. I've had to add these folders to .gitignore and .eslintignore because the autogenerated code doesn't conform to my eslint config.

All 5 comments

Also applies to the cypress/support folder. I've had to add these folders to .gitignore and .eslintignore because the autogenerated code doesn't conform to my eslint config.

Bump, this is really irritating behaviour.

This will be covered as part of the cypress init proposal https://github.com/cypress-io/cypress/issues/619

This is still an issue if you use cypress open.

Was this page helpful?
0 / 5 - 0 ratings