1//Angular - Jasmine
2//Mock BsModalService
3
4describe('...', () => {
5 //...
6 const bsModalServiceStub= {
7 show: jasmine.createSpy('show').and.callFake(function () {
8 return {
9 content: {
10 event: new EventEmitter()
11 }
12 };
13 }),
14 hide: jasmine.createSpy('hide').and.callThrough(),
15 };
16 //...
17 beforeEach(() => {
18 TestBed.configureTestingModule({
19 providers: [
20 { provide: BsModalService, useValue: bsModalServiceStub }
21 ]
22 });
23 //...
24}