Comment

Comment by mrkeen

My take is that your business logic shouldn't know about your storage tech. (Like, dependency inversion 101 right?)

> Still, using an in-memory db is way better than mocking, the tests are not coupled to the implementation details/the underlying model.

Isn't this backwards? The fact that you've backed your storage with a HashMap (which is 100% what I shoot for too) means your service-under-test cannot know if it's talking to an SQL database.

parent mrkeen 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton