karma jasmine - Testing a public method that calls subscribe on private property angular -


i'm in process of learning angular 2 , working on unit tests app. have service that's similar following:

    @injectable()   export class modalservice{           private onclose  = new subject<boolean>();     public subscribeonmodalclose(closehandler:any):void {       this.onclose.subscribe(closehandler);     } } 

i'm not sure how should go testing subscribeonmodalclose(). i'm thinking should make sure .subscribe() gets called when actual method gets called. i'm not sure how check that, considering onclose$ private property.

any appreciated.


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -