Echo JS 0.11.0

<~>

philipwalton comments

philipwalton 3950 days ago. link 2 points
This advice is good, but it certainly does not apply 100% of the time.

Sometimes the public API can work fine and pass all tests even though the private functions aren't doing their job correctly.

Consider a public function that takes a URL and a callback. It makes a request to the URL and invokes the callback with the response once it's completed. In addition to simply making a request, there are some private, helper functions that do some caching behind the scenes so that you never make the same request twice.

If you were to simply test that public function, you would never know if the cache was working properly or not because if it was broken, you'd just do the request as normal.