-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[HOLD for payment 2023-11-21] Unified testing utilities for mocks using a fake data generation library #30994
Comments
Triggered auto assignment to @lschurr ( |
@adhorodyski can you please comment on this issue? @lschurr nothing required for this one right now |
@mountiny sure thing, I'd like to work on this. |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.98-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-11-21. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
This is completed, nothing to pay out |
Problem
Mocking data with confidence is crucial when developing tests, especially for an offline-first data-driven app. What I saw myself was a lack of predefined mocking strategies, which combined with the poor type-safety led me to a lot of errors and frustration. Each test file (when written by different people over time) had to reinvent the wheel when it comes to working with reports, reportActions, policies and so on.
Solution
By introducing a fake data library (my pick was ngneat/falso - it’s more lightweight and composable than the popular faker module) as a dev dependency we can unify our mocks across the whole project and improve the DX of our teams when testing.
The example below shows whole entities being mocked, but with composition we can also generate useful partials.
The text was updated successfully, but these errors were encountered: