If the dependencies are updated and the API changed, then our test will not' fail because the mocks did not get updated.
Which is why integration tests should always be done with real dependencies.
On top of that dependency injection is a anti-pattern on the level of inflection and convention over configuration.
It's hard to debug, hard to test, and hard to maintain or requires a lot of domain knowledge.
We have functional programming patterns today, which can serve the same purposes but without the drawbacks listed above.
TL;DR Use arguments, not dependency injection.
Dependency injection is how you get AngularJS (and Angular for mysterious reasons).
Edit, Mis-worded a sentence.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If the dependencies are updated and the API changed, then our test will not' fail because the mocks did not get updated.
Which is why integration tests should always be done with real dependencies.
On top of that dependency injection is a anti-pattern on the level of inflection and convention over configuration.
It's hard to debug, hard to test, and hard to maintain or requires a lot of domain knowledge.
We have functional programming patterns today, which can serve the same purposes but without the drawbacks listed above.
TL;DR
Use arguments, not dependency injection.
Dependency injection is how you get AngularJS (and Angular for mysterious reasons).
Edit, Mis-worded a sentence.