--

The answer is the same for every PL: you don't. Privates shuold be covered (hence via code coverage tools) indirectly through public APIs. This is not a JS thing, it's a universal concept of privates that cannot be accessed directly, otherwise these wouldn't be private. Not exposed closures and utilities are the same: write tests that cover all your code, don't access directly stuff you should never access directly out there.

--

--

Andrea Giammarchi
Andrea Giammarchi

Written by Andrea Giammarchi

Web, Mobile, IoT, and all JS things since 00's. Formerly JS engineer at @nokia, @facebook, @twitter.

No responses yet