Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON fixtures format on test run #902

Closed
Graham42 opened this issue Nov 10, 2017 · 7 comments
Closed

JSON fixtures format on test run #902

Graham42 opened this issue Nov 10, 2017 · 7 comments
Assignees
Labels
pkg/server This is due to an issue in the packages/server directory type: unexpected behavior User expected result, but got another
Milestone

Comments

@Graham42
Copy link
Contributor

  • Operating System: Ubuntu 16.04
  • Cypress Version: 1.0.3
  • Browser Version: N/A

Is this a Feature or Bug?

Bug

Current behavior:

Whenever I run a test using a json fixture, the fixture file gets formatted. In my project I format all possible files using prettier. This includes json. The formatting that cypress applies conflicts with prettier. Specifically empty object blocks. ({})

Desired behavior:

Ideal: Format using prettier instead of whatever is used now.
Acceptable: Don't format fixtures.

How to reproduce:

  1. Create a test using a json fixture with the contents formatted by prettier.
    Example:
    https://prettier.io/playground/#N4Igxg9gdgLgprEAuEwA6UAEm3mgMwEsBzXJTdKDbAXwBocscR8IIzLttcAjAQwBOZTAEZqmGhhog6ICAAcYhaAGdkoPipjJ8fADYq4sngL5gA1nBgBleWcJRiyGAICuRkABMIYHfsOyAFYqAB4AQqYWVtZ8ALZwADIOcH4GHhCuMPKZAEypASB2AoYCyCDB0DKFAg4wAOqEnjAAFsgAHAAMsoaxhM5uHioOxHpwAIquEPD5HjB8PA1NrUg5si58hHrDAMIQsbF8ZVDQKbKuhgAq82pIumk0NEA
  2. Run the test.
  3. Check the file for format differences.

Test code:

See https://github.com/Graham42/cypress-bug-format-fixures

@MarcLoupias
Copy link

Duplicate : #884

@Graham42
Copy link
Contributor Author

I don't think so, #884 looks like it is specifically a windows issue with line endings

@bahmutov
Copy link
Contributor

bahmutov commented Nov 10, 2017 via email

@MarcLoupias
Copy link

I disagree that #884 is related to windows only, the issue is not about windows formatting, it is that cypress is rewriting the fixtures files instead of doing read-only.

@bahmutov bahmutov self-assigned this Nov 16, 2017
@bahmutov bahmutov added type: bug type: unexpected behavior User expected result, but got another labels Nov 16, 2017
@brian-mann
Copy link
Member

#884 (comment)

@jennifer-shehane jennifer-shehane added stage: ready for work The issue is reproducible and in scope and removed type: bug labels Nov 16, 2017
@bahmutov bahmutov added this to the 1.1.0 milestone Nov 16, 2017
@bahmutov bahmutov added pkg/server This is due to an issue in the packages/server directory stage: pending release and removed stage: ready for work The issue is reproducible and in scope labels Nov 16, 2017
@brian-mann
Copy link
Member

Released in 1.1.0.

@Graham42
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/server This is due to an issue in the packages/server directory type: unexpected behavior User expected result, but got another
Projects
None yet
Development

No branches or pull requests

5 participants