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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -