DEV Community

Discussion on: NestJS - The missing piece to easily develop full-stack TypeScript web applications

 
johncarroll profile image
John Carroll • Edited

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.