I have a public method A() in service which modifies a private data member of that service.
A() {
//call http
// change private data member using call's result
}
I am unit testing a component that uses this service and thus want to change the data member by using spyOn.and.callFake() functionality of Jasmine. However, as the data member is private, I can't access it in the component using the service object. I don't want to make the data member public for the purpose of a test.
What should be the best practice here?