dependencies
dependencies copied to clipboard
Add service locator with mocks contr-example.
Service locator needs massive changes in the code base. We can avoid it with TestInjector or Mocker which will need to define ones.
So if we need to add injection to the callable:
- With
Mockeradd one argument to the globalTestInjector. - With service locator change each call to
@mock.patch(services, ...in each test method.
Why not call argument example:
Aka props drilling
foo(x, y)
-> bar(x)
-> baz(x)
-> quiz(y)
Instead of passing y argument all the way down to quiz, quiz itself can be bound to y. So bar and baz does not need to know about quiz implementation details (like y value).

