Skip to content

Commit

Permalink
fix(test): fix test for http2 with null socket
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleytodd committed Sep 2, 2024
1 parent db834a9 commit c45583d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,19 +607,18 @@ var topDescribe = function (type, createServer) {
if (parseInt(process.version.split('.')[0].replace(/^v/, ''), 10) > 11) {
describe('req.socket', function () {
it('should not throw when socket is null', function (done) {
request(createServer(function (req, res, next) {
wrapper(request(createServer(function (req, res, next) {
res.statusCode = 200
res.end('ok')
process.nextTick(function () {
req.socket = null
next(new Error())
})
}))
.get('/')
.end(function () {
assert.strictEqual(this.res.statusCode, 200)
assert.strictEqual(this.res.text, 'ok')
done()
.get('/'))
.expect(200)
.end(function (err) {
done(err)
})
})
})
Expand Down

0 comments on commit c45583d

Please sign in to comment.