Comment

Comment by jjrumi

In my case, most of the time mocks are used to avoid Database interactions: They are dangerous for writing and slow for reading.

The best thing I've run into lately have been "mocking" the DB creating a copy (temporary tables with only the needed data) of the tables that the code interact with.

This way you create a "mock" of the data you're going to work with and code the test getting a more reliable test in my opinion.

parent jjrumi 15 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton