I am facing an issue with a nock interceptor that is intercepting calls from an async function (which returns a promise)
public async backendRes(): Promise<container> {
get some data from the backend
return new container(stat, body, header);
}
When I call it using nock like this:
nock()
.get('/goodey')
.reply(async function () {
let abc = await global.MyClass.backendRes();
return [abc.getStatus(), abc.getBody(),
abc.getHeader()];
});
Unfortunately, this setup is not working correctly. The reply within the nock seems to be incorrect, but I'm unsure how to resolve it. Any assistance would be greatly appreciated.