Cypress: Something creates fixtures/example.json repeatedly ...

Created on 3 Nov 2018  路  8Comments  路  Source: cypress-io/cypress

I am trying to find out what / why creates fixtures/example.json file with the following content even if it's not the first run of cypress open or cypress run on a project.

{
  "name": "Using fixtures to represent data",
  "email": "[email protected]",
  "body": "Fixtures are a great way to mock data for responses to routes"
}

We removed the example tests (created on the first run of cypress open) from our repository (because of it's not necessary / misleading for the app) but fixtures/example.json file is repeatedly created accidentally during following runs of cypress on that project.

Can anybody explain why it happens? Is it a real bug? Or there are some reasons?

Environment:
Cypress 3.1.1
Windows 10
NodeJS 10.2.1

unexpected behavior

Most helpful comment

I had the same issue. A workaround is to explicitly set the fixturesFolder in cypress.json.
"fixturesFolder": "cypress/fixtures"

For some reason this prevents cypress from regenerating the example file.

All 8 comments

I had the same issue. A workaround is to explicitly set the fixturesFolder in cypress.json.
"fixturesFolder": "cypress/fixtures"

For some reason this prevents cypress from regenerating the example file.

@mattbgold ... thanks for your advice. 馃樅 I set it ... and we'll see if it helps.

This issue will be fixed at the introduction of cypress init outlined here: https://github.com/cypress-io/cypress/issues/619

Going to close since you've found a temporary workaround and would be covered with the linked issue.

This workaround didn't work for me and cypress init still hasn't been added.

I had the same issue. A workaround is to explicitly set the fixturesFolder in cypress.json.
"fixturesFolder": "cypress/fixtures"

Didn't work for me on Cypress 3.8.3

Running Cypress 4.0.2, and the issue still exists.

I've added a .gitignore to the cypress folder:

/fixtures/example.json
/screenshots
/videos

Encountered the same issue with version4.8.0. The workaround in cypress.json did not work either.

Keeping the generated folders (not the generated files) with a .gitkeep seems to help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SecondFlight picture SecondFlight  路  3Comments

rbung picture rbung  路  3Comments

weskor picture weskor  路  3Comments

jennifer-shehane picture jennifer-shehane  路  3Comments

EirikBirkeland picture EirikBirkeland  路  3Comments