MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/24a87h/programming_sucks/ch5rdji/?context=3
r/programming • u/locrelite • Apr 29 '14
1.1k comments sorted by
View all comments
Show parent comment
2
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.
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.