I have a service that I am trying to unit test however I can't get to the functions in the service which are supposed to be private only to that module. In order to test it and put spies on it I have to expose that function to other modules. I feel this defeats the purpose of encapsulation and is a coding no-no.
These four functions, for example, are helper functions and are NOT used by any other module other than the one it is in. There is absolutely no point in putting it in the 'vm' object which is instantiated as 'this' for convention. This exposes it to other modules to use. I do not want this. However, if I don't my tests fail because my jasmine tests can't access them. :
So is the solution to expose all the functions I want to test to all of my other modules so they can be unit tested or is there a way I can access these variables from my tests without exposing them to everything.
