Skip to content

Commit b6fd281

Browse files
committed
fix: revert automatic server closing (per #651)
1 parent 75bcbc9 commit b6fd281

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

lib/test.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ class Test extends Request {
6060
serverAddress(app, path) {
6161
const addr = app.address();
6262

63-
if (!addr) {
64-
this._server = app.listen(0);
65-
} else {
66-
this._server = app;
67-
}
63+
if (!addr) this._server = app.listen(0);
64+
// } else {
65+
// this._server = app;
66+
// }
6867
const port = app.address().port;
6968
const protocol = app instanceof Server ? 'https' : 'http';
7069
return protocol + '://127.0.0.1:' + port + path;

test/supertest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,8 +1444,8 @@ describeHttp2('http2', function() {
14441444
.end(function (err, res) {
14451445
res.status.should.equal(200);
14461446
res.text.should.equal('hey');
1447-
// Let supertest handle server closing
1448-
done();
1447+
// lose the external server explicitly
1448+
server.close(done);
14491449
});
14501450
});
14511451
});

0 commit comments

Comments
 (0)