JSON fixtures format on test run
See original GitHub issue- 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:
- Create a test using a json fixture with the contents formatted by prettier. Example: https://prettier.io/playground/#N4Igxg9gdgLgprEAuEwA6UAEm3mgMwEsBzXJTdKDbAXwBocscR8IIzLttcAjAQwBOZTAEZqmGhhog6ICAAcYhaAGdkoPipjJ8fADYq4sngL5gA1nBgBleWcJRiyGAICuRkABMIYHfsOyAFYqAB4AQqYWVtZ8ALZwADIOcH4GHhCuMPKZAEypASB2AoYCyCDB0DKFAg4wAOqEnjAAFsgAHAAMsoaxhM5uHioOxHpwAIquEPD5HjB8PA1NrUg5si58hHrDAMIQsbF8ZVDQKbKuhgAq82pIumk0NEA
- Run the test.
- Check the file for format differences.
Test code:
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Simple json fixtures with test rules and annotations - GitHub
Json -Fixtures is a library to simplify tests. You can define fixtures using json and load inside your tests using annotations.
Read more >Fixtures (JSON file) for UI Testing - javascript - Stack Overflow
Fixtures (JSON file) for UI Testing ... Has anybody used fixtures (json file) to load the data in postgres database and execute UI...
Read more >Dynamic Tests From Cypress.io Fixture File - YouTube
This video shows how you can import a JSON fixture file into the Cypress spec and create a separate test for each data...
Read more >What are Fixtures in Cypress? How to Implement ... - Tools QA
Fixtures enable data-driven automation in Cypress by saving the test data in JSON format · Cypress allows the same test script to run...
Read more >Dynamic Tests From Cypress Fixture - Gleb Bahmutov
Import a JSON fixture file to create dynamic Cypress tests ... Often, you need to run the same test with different data. For...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you!
Released in
1.1.0
.