Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Dependency Injection is orthogonal to what the author is talking about.

Like the other commenter explained, DI simply means that the function would depend on an abstract dependency which is supplied at runtime or test time.

In runtime you can supply the actual DB, in test, you can supply a mock DB, OR an actual DB. Both are possible approaches. It's about how you want to wire up your tests.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: