Я попытался воспроизвести: component.ts
testFunction1() {
this.testFunction2();
}
testFunction2() {
}
spec.ts:
it('should call functions', () => {
let spyOnCreateEntitlement = spyOn(component, 'testFunction1').and.callThrough();
let spyOnSetRecord = spyOn(component, 'testFunction2').and.callThrough();
component.testFunction1();
expect(spyOnCreateEntitlement).toHaveBeenCalled();
expect(spyOnSetRecord).toHaveBeenCalled();
});
=> тест пройден.Я предполагаю, что причина в том, что у вас есть 'ожидайте (func1) .toHaveBeenCalled ()', вы должны либо указать здесь свое имя шпиона, либо ИЛИ component.func1