| ▲ | z3t4 9 hours ago | |
If you make the function pure it will be easier to test. Pass the moving parts as function parameters, then you can pass in the mocks in the actual functions when testing. Example:
refactor for easier testing
in your test you can now mock a and b | ||