But I’m just hoping to share that Jest, Sinon, and most JS libraries that impliment spies allow you to mock any dependency.
In my case, I haven't used DI for tests but rather for production code. As a real world example, this angular module for working with cookies allows you to replace the CookieService with a CookieBackendService when rendering your app on the server side. As always with programming, I'm sure there are other ways you could accomplish the same thing.
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.
In my case, I haven't used DI for tests but rather for production code. As a real world example, this angular module for working with cookies allows you to replace the
CookieService
with aCookieBackendService
when rendering your app on the server side. As always with programming, I'm sure there are other ways you could accomplish the same thing.