angular jasmine bsmodalservice mock

Solutions on MaxInterview for angular jasmine bsmodalservice mock by the best coders in the world

showing results for - "angular jasmine bsmodalservice mock"
Eleonora
02 May 2017
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}