Hi, I know it doesn't recommended to jest.spyOn on a function that been mocked but i'm trying to check that every call in a service method is called and returns a specific value. i'm getting:
● Crop Service › update › successfull call › should be called 1 time and with CropType id and return a croptype entity
expect(received).resolves.toHaveReturnedWith()
Matcher error: received value must be a promise
Received has type: function
Received has value: [Function mockConstructor]
174 | expect(spyConnection).toBeCalledTimes(1);
175 | expect(spyConnection).toBeCalledWith(updateCrop.typeId);
176 | await expect(spyConnection).resolves.toHaveReturnedWith(oneCropType);
| ^
177 | });
178 | });
179 | });
at Object.toHaveReturnedWith (../node_modules/expect/build/index.js:181:13)
at Object.<anonymous> (modules/crops/services/crop.service.spec.ts:176:54)