i am not able get the resolved value in the response the promise stub returns undefined
otpHelper.sendOtp = (number) => {
console.log('number', number);
return Promise.resolve({ status: '0', requestId: 'hdgfhsgdfdsgfjsgdfj' });
};
sendOtpStub = sinon.stub(otpHelper, 'sendOtp');
const otpHelperStub = proxyquire('../routes/register', {
'../utils/otpHelper': {
sendOtp: sendOtpStub,
// checkOtp: checkOtpStub,
},
});
sendOtpStub
is called but the value that i get is undefined
i need to get the resolved value from the promise.its resolving to undefined
am using if am not using the stub its working as expected.
if i put sendOtp: otpHelper.sendOtp
its working as expected but when i make it as a stub its not returning the resolved value.