Company
Date Published
Author
Mitchell Adair
Word count
1542
Language
English
Hacker News points
None

Summary

We have migrated from Jest and React Testing Library (RTL) to Cypress Component Testing (CCT) for UI integration tests at SingleStore. The main reasons for this migration were the flakiness of our previous integration tests, which were causing issues with debugging and performance. We found that RTL's JSDOM simulated rendering made it difficult to visually inspect test results, leading to slower test execution due to CSS not being considered in tests. Additionally, we experienced issues with Jest's slow startup times as more tests were added. The flakiness of our integration tests was mostly a mystery, but we identified improperly written tests and missing API mocks as common causes. We decided to move to CCT instead of fixing the underlying issues due to its familiarity and the fact that our end-to-end tests were already written with Cypress. Our experience with CCT has been very positive, with improved test realism, faster onboarding for new engineers, and better developer experience through Cypress's API. However, we still have some flakiness in our integration tests that we are investigating.