Merge pull request #834 from Bruception/master · forwardemail/supertest@225118c (original) (raw)

Original file line number Diff line number Diff line change
@@ -26,7 +26,9 @@ const Test = require('./test.js');
26 26 function TestAgent(app, options = {}) {
27 27 if (!(this instanceof TestAgent)) return new TestAgent(app, options);
28 28
29 -Agent.call(this, options);
29 +const agent = new Agent(options);
30 +Object.assign(this, agent);
31 +
30 32 this._options = options;
31 33
32 34 if (typeof app === 'function') {