question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress auto-generates files too aggressively

See original GitHub issue
  • 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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
willclarktechcommented, Oct 12, 2017

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.

4reactions
nrhoffmanncommented, Sep 7, 2020

This is still an issue if you use cypress open.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keep your Documentation updated with Cypress and Github ...
One of my favorite ways to document projects is by adding screenshots of how it looks, to provide a quick overview of what...
Read more >
Setting up the first acceptance tests in GitLab CI pipeline
First, we install cypress from npm and run yarn cypress open to get the autogenerated skeleton. After adding the typescript, renaming files ......
Read more >
Best Practices - Cypress Documentation
Best Practice: Use data-* attributes to provide context to your selectors and isolate them from CSS or JS changes. Every test you write...
Read more >
Loading Data with Fixtures - YouTube
We will use fixture data to seed our application state. As we iterate on our test and app code, ... Follow along at...
Read more >
Cypress browser recorder [closed] - Stack Overflow
However, you must consider that the captured and auto-generated tests in Katalon can become messy and hard to maintain.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found