Cannot read properties of undefined (reading 'prototype')
Closed this issue ยท 5 comments
ihorbond commented
Hey thanks for this package! I have the following issue: when it's used with https://www.npmjs.com/package/supertest
the following line breaks
https://github.com/BedrockStreaming/superagent-mock/blob/v5.0.0/src/superagent-mock.js#L15
because the agent object exposed by supertest doesn't have a Request property, I'm assuming that's the issue
https://github.com/ladjs/supertest/blob/v6.3.3/lib/agent.js#L51
I know that it sounds like a supertest issue but was wondering if you'd be interested to update you plugin as well ?
ihorbond commented
for now I added it manually to the agent instance exposed by supertest:
agent.Request = { prototype: { end: function () {} } };