loading...

re: The difference between mocks and stubs, explained with JS VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hello Snir, thanks for this. I really appreciate this article. I have never taken unit testing in js seriously. I only look upon unit testing serve...
 

Thank you for the comment (:
Actually everything I described here still stands in any context, frontend as well as backend testings with nodejs.

Everything you say is right as well, mocks allow you the fake a behaviour of certain object, and to test the behavior in place. This is why it is recommended to just use mock on one object per test unit - this way you make sure you are testing just one behaviour and not looking at some irrelevant internals.

Regarding the JS and Python beingh dynamic languages - I think this is another, super interesting and dense, discussion. About the correctness of languages without static types and how you should test them differently than statically typed languages (if you should do it differently, at all).

Code of Conduct Report abuse