Skip to content

Commit c45583d

Browse files
committed
fix(test): fix test for http2 with null socket
1 parent db834a9 commit c45583d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

test/test.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -607,19 +607,18 @@ var topDescribe = function (type, createServer) {
607607
if (parseInt(process.version.split('.')[0].replace(/^v/, ''), 10) > 11) {
608608
describe('req.socket', function () {
609609
it('should not throw when socket is null', function (done) {
610-
request(createServer(function (req, res, next) {
610+
wrapper(request(createServer(function (req, res, next) {
611611
res.statusCode = 200
612612
res.end('ok')
613613
process.nextTick(function () {
614614
req.socket = null
615615
next(new Error())
616616
})
617617
}))
618-
.get('/')
619-
.end(function () {
620-
assert.strictEqual(this.res.statusCode, 200)
621-
assert.strictEqual(this.res.text, 'ok')
622-
done()
618+
.get('/'))
619+
.expect(200)
620+
.end(function (err) {
621+
done(err)
623622
})
624623
})
625624
})

0 commit comments

Comments
 (0)