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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -