Update: A lot of readers have commented or tweeted that I shouldn’t be unit testing private functions in the first place. Admittedly, this article is a little light on the why and mainly focuses on the how. To explain some of my rationale, I wrote a follow-up article: Why I Test Private Functions In JavaScript JavaScript’s closures provide an excellent way to make variables and functions private,