News for hackers. Stuff that matters.
Re:How to Test Private Functions in JS Modules by kevin1024 on Tuesday July 29, 2014 @06:46PM (#8105433)
Very cool solution! I've also seen claims that the private methods of modules should not be tested, since they don't represent the public interface of the module and refactorings are likely to change the private methods. If the private methods are complicated enough to warrant testing on their own, ideally they should be extracted into their own module. Not sure if I agree but it's something to think about!
Re:How to Test Private Functions in JS Modules by gaelow on Tuesday July 29, 2014 @07:30PM (#8105570)
"Private methods of modules should not be tested, since they don't represent the public interface of the module and refactorings are likely to change the private methods"

+1 to that.

Re:How to Test Private Functions in JS Modules by jonahkagan on Tuesday July 29, 2014 @07:29PM (#8105561)
What if the private methods are complex but also module-specific? For instance, if they deal with a data type that is private to the module?

When you pull out complex code like this into another module, how do you specify that the new module is actually private to the old module?

Re:How to Test Private Functions in JS Modules by jonahkagan on Tuesday July 29, 2014 @07:30PM (#8105569)
(They are very good points though! Thanks for sharing them)