I'm trying to test this method: doResetForm(){ this.form.reset(); } so I tried: it('should reset the form', () => { const spyformReset = jest.spyOn(component.form, 'reset'); fixture.detectChanges(); component.doResetForm(); expect(spyformReset).toHaveBeenCalled(); } but I'm getting the error: Cannot spyon on a primitive value, undefined give Continue reading...