Skip to content

JSON fixtures format on test run #902

@Graham42

Description

@Graham42
  • 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

Metadata

Metadata

Assignees

Labels

pkg/serverThis is due to an issue in the packages/server directorytype: unexpected behaviorUser expected result, but got another

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions