-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Improve frontend unit-testing experience #26960
Comments
I don't know if this is a blocker for us for MSW, but it does not support concurrent runs in jest This can be a problem when you have tests running concurrently that are trying to mock different API response payloads - you can't predict which one you will get, because it overwrites response handlers I think Nock is not susceptible to this issue, but haven't used it, so can't comment on other possible pitfalls. |
Amazing job everyone involved in this massive task! 👏 🎉 |
Problem
We heavily rely on Cypress E2E tests in our quality process, probably way more than we actually should. One of the reasons people tend to write more E2E tests instead of more lightweight jest tests is because the toolchain and overall process can be confusing:
xhr-mock
, more details in Migrate away from XMLHttpRequest #17906frontend/test/metabase
, and we prefer to keep tests close to the source code nowadays)Suggested Solution
We want to get to the point when every FE engineer on the team can put together a simple test using shared helpers and quickly be able to:
Tasks
⏳ Total ETA for this is around 1-2 weeks
Milestone 1
renderWithProviders
test utility #27398Milestone 2
renderWithProviders
utility #27552eslint-plugin-jest
#27574frontend/test/metabase
closer to the files they coverrenderWithProviders
,setupEnterpriseTest
, sample dataset helpers, etc.) and make them easy to discoverThe text was updated successfully, but these errors were encountered: