Is there any way to test the private method or declaration using "testing-library" framework in angular?
here is my code:
priave name = "somename"
private setLang(url: string, fetch: boolean) {
switch (url) {
case '/SSB/mngt':
this.SSB.Id = 'newSSb';
this.pageId = 'ManageEvent';
break;
case '/SSB/mngt/add':
this.SSB.Id = 'newSSb';
this.pageId = 'ManageEventAdd';
break;
case '/SSB/mngt/view':
this.SSB.Id = 'newSSb';
this.pageId = 'ManageEventView';
break;
case '/SSB/mngt/approve':
this.SSB.Id = 'newSSb';
this.pageId = 'ManageEventApprove';
break;
default:
this.SSB.Id = 'setupConfig';
this.pageId = 'ViewProgMgmt';
break;
}
this.data = [];
this.data.push(this.selectedLang);
this.data.push(this.SSB.Id);
this.data.push(this.pageId);
this.data.push(fetch);
this.langId.emit(this.data);
}
both the private name
declaration and setLang
method not available there is spec file. What would be the correct way to handle. it seems that, unless i write the test case for my both private declaration, i could not achieve coverage as 100%.