DEV Community

Discussion on: Whats your thoughts on using a DI Package for IOC within a node project?

mfaghfoory profile image
Meysam Faghfouri • Edited on

In my opinion, the least benefit that we'll have by using a DI is that we can test our upstream layers and services with fake dependencies as Angular does (for example you can inject an in-memory http interceptor and provide some fake data for testing purposes) without doing a lot of boring changes. another one is that you can change your application's behavior by changing dependencies in just one place without changing those in every place (Open-Closed principle).

dechamp profile image
DeChamp Author

With jest, we are able to mock the modules and do the same effect. We finally went without DI module as we found we could do it using vanilla js.