We use Cypress and cypress-image-snapshot
for snapshot testing. Unfortunately we have issues with our colleagues based in another countries running the tests since they fail because of different timezones.
In our date related components we pass strings in ISO 8601 format to set the date.
For our jest tests we use mocks (Components using Date objects produce different snapshots in different timezones) but not quite sure how to handle the situation in Cypress.
You can open browser with different TZ from server by adding specific timezone before open, in this way
"scripts": {
"cypress:open": "TZ=America/New_York cypress open",
"cypress:run": "TZ=America/New_York cypress run"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With