-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: TestAgent not inheriting Agent properties #834
Conversation
@@ -26,7 +26,9 @@ const Test = require('./test.js'); | |||
function TestAgent(app, options = {}) { | |||
if (!(this instanceof TestAgent)) return new TestAgent(app, options); | |||
|
|||
Agent.call(this, options); | |||
const agent = new Agent(options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this commit to change from functions to classes breaks this behavior.
ladjs/superagent@fca95a3
The apply
hook in the Proxy seems to discard the this
reference and so it is not being binded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks promising (and explanation makes sense) 👀
#833
Checklist