Demo post with code.
Resolve, don't import
ts
const getDb = () => getContainer().get<DbInstance>(ServiceName.DB);
Swap in tests
Register a fake before the test and the service code never knows.
Keep getters at the top
A getter per service at the top of the file reads well and mocks well.