Aktueller Stand

This commit is contained in:
2026-01-22 19:05:45 +01:00
parent 85dee61a4d
commit e280e4eadb
1967 changed files with 397327 additions and 74093 deletions

View File

@@ -1,21 +1,20 @@
'use strict'
const t = require('tap')
const { test } = require('node:test')
const Fastify = require('../fastify')
// asyncDispose doesn't exist in node <= 16
t.test('async dispose should close fastify', { skip: !('asyncDispose' in Symbol) }, async t => {
test('async dispose should close fastify', { skip: !('asyncDispose' in Symbol) }, async t => {
t.plan(2)
const fastify = Fastify()
await fastify.listen({ port: 0 })
t.equal(fastify.server.listening, true)
t.assert.strictEqual(fastify.server.listening, true)
// the same as syntax sugar for
// await using app = fastify()
await fastify[Symbol.asyncDispose]()
t.equal(fastify.server.listening, false)
t.assert.strictEqual(fastify.server.listening, false)
})