Skip to content

Commit f51396a

Browse files
committed
fix http2 test
1 parent 0b75cf0 commit f51396a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

test/http2.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ test('#3046 - GOAWAY Frame', async t => {
15271527
t.strictEqual(response.headers['x-custom-h2'], 'hello')
15281528
t.strictEqual(response.statusCode, 200)
15291529

1530-
t.rejects(response.body.text(), {
1530+
await t.rejects(response.body.text(), {
15311531
message: 'HTTP/2: "GOAWAY" frame received with code 0',
15321532
code: 'UND_ERR_SOCKET'
15331533
})
@@ -1717,7 +1717,6 @@ test('Should handle http2 stream timeout', async t => {
17171717
'x-custom-h2': headers['x-my-header'],
17181718
':status': 200
17191719
})
1720-
17211720
setTimeout(() => {
17221721
stream.end('hello h2!')
17231722
}, 500)
@@ -1748,9 +1747,11 @@ test('Should handle http2 stream timeout', async t => {
17481747
body: stream
17491748
})
17501749

1751-
t.rejects(res.body.text(), {
1750+
await t.rejects(res.body.text(), {
17521751
message: 'HTTP/2: "stream timeout after 50"'
17531752
})
1753+
1754+
await t.completed
17541755
})
17551756

17561757
test('Should handle http2 trailers', async t => {

0 commit comments

Comments
 (0)