logoalt Hacker News

danparsonsonyesterday at 11:24 PM2 repliesview on HN

How do you substitute for dependencies that you're not testing, or that you want to deliberately break?


Replies

bluGillyesterday at 11:32 PM

90% of the time (or more): you don't. The real thing is perfectly fine in a test with the right setup. Fileio is fast, I just need a test file in a tempdir. databases are fast, I just need an easy way to settup my schema. Sometimes I need the isolation but normally I do not.

show 4 replies
mangodrunktoday at 12:52 AM

Why substitute dependencies? Is the isolation worth it?

show 1 reply