Comment

Comment by dgb23

Put a small data interface around your IO, have it return DATA | NOT_FOUND etc.

Then your tests don't need behavioral mocks or DI, they just need the different shapes of data and you test your own code instead of whatever your IO dependency is or some simulation thereof.

parent dgb23 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton