r/programming • • Apr 29 '14

Programming Sucks

http://stilldrinking.org/programming-sucks
3.9k Upvotes

1.1k comments sorted by

View all comments

Show parent comment

2

u/dnew Apr 30 '14

The right way to do mocks is to test two levels down from what you're doing.

The JS tests that invoke the web server don't mock out the web server; they mock out the database.

The server tests don't mock out the database; they mock out the underlying file system.

If you're mocking what's directly underneath you, you're not going to get any benefit.