Say it's a patch, first enter the patch patch return value:
this.mockPatchObject = { set: () => { return { end: (cb: any) => { cb(null, {body: 'etc'}); }, }; }, };
then return it as the value of the patch:
this.superagentSpy = spyOn(request,'patch').and.returnValue(this.mockPatchObject);
then look at the set function of the mock patch object:
this.superagentSetSpy = spyOn(this.mockPatchObject, 'set');
Flavorcape
source share