I have this method
loadCombos(): void {
this.combosService.accounts$.subscribe(
(data: any) => {
this.list = data;
}
}
);
}
and this is my current test:
it('should test loadCombos executions ', (done) => {
combosService = TestBed.inject(CombosService);
spyOn(combosService.accounts$, 'subscribe').and.returnValue(of(mockList));
component.loadCombos();
expect(component.list).not.toBeNull();
done();
});
how can I use mockList on my test, currently I'm getting that's an observable but it needs a suscription, but I don't know how to do it.
Aucun commentaire:
Enregistrer un commentaire