Skip to content

Commit 329c916

Browse files
authored
test: refactor test (#16)
1 parent b6b9ab1 commit 329c916

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
node: [16.x, 18.x]
9+
node: [16.x, 18.x, 19.x]
1010
name: Node ${{ matrix.node }}
1111
steps:
1212
- uses: actions/checkout@v3

test/index.test.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,12 @@ tap.test('fastify-racing#promise', { only: true }, subtest => {
266266
}
267267
)
268268

269-
// TODO: Find how to close the socket after request finished
270269
subtest.test('Should throw on already closed request', async t => {
271270
// eslint-disable-next-line
272-
let first, client
271+
let first
273272
const app = fastify()
274273

275-
t.teardown(async () => {
276-
await client.destroy()
277-
await app.close()
278-
})
274+
t.teardown(app.close.bind(app))
279275

280276
t.plan(7)
281277

@@ -309,7 +305,9 @@ tap.test('fastify-racing#promise', { only: true }, subtest => {
309305

310306
await app.listen({ port: 0 })
311307

312-
client = new Client(`http://localhost:${app.server.address().port}`)
308+
const client = new Client(`http://localhost:${app.server.address().port}`, {
309+
pipelining: 0
310+
})
313311

314312
const response = await client.request(
315313
{

0 commit comments

Comments
 (0)