News for hackers. Stuff that matters.
Re:How to Test Private Functions in JS Modules by wilmoore on Friday August 01, 2014 @04:37PM (#8122681)
Exactly...coupling is more detrimental than one would think. As your codebase gets larger and more developers on-board and features change, what should have been a simple refactor can turn into a nightmare as your test suite starts to give false negatives because you've changed the implementation or removed a now unused private function that your tests relied upon directly. Writing unit tests directly against private functions is a good way to ensure your team's velocity doesn't scale as well as it should.

Unit tests will serve you better when written to assert results rather than implementation details.

There are no comments on this comment yet.