angular jasmine BsModalService mock
//Angular - Jasmine
//Mock BsModalService
describe('...', () => {
//...
const bsModalServiceStub= {
show: jasmine.createSpy('show').and.callFake(function () {
return {
content: {
event: new EventEmitter()
}
};
}),
hide: jasmine.createSpy('hide').and.callThrough(),
};
//...
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
{ provide: BsModalService, useValue: bsModalServiceStub }
]
});
//...
}