I was coding test cases for an angular application using jasmine. But many internal methods are declared as private in the services.
Example:
App.service
To test inner functions I call the outer function that calls the inner function and then vary my input according to what the inner function requires. So, in your case you would call productDisplay
and vary your input based upon what myPrivate
needs and then verify that you have the expected output. You could also spy on myPrivate
and test things that way using .havebeencalledwith
or .andcallthrough
.