Open
Description
In much of this library, we use functions as constructors and add methods to the prototype, using util.inherits
for inheritance
We should probably rework this to use classes now that they're widely available.
For example:
Lines 307 to 318 in cc58a4b
Could be:
class TestAgent extends (Agent || Request) {
constructor(app) {
super();
if (typeof app === 'function') app = http.createServer(app);
this.app = app;
if (typeof app !== 'string' && app && app.listen && app.address && !app.address()) {
this.app = app.listen(0)
}
}
close(callback) {
// ...
}
}