strong-tie/inbound-calls
0
1'use strict'2 3const { test } = require('node:test')4const Fastify = require('../fastify')5 6// asyncDispose doesn't exist in node <= 167test('async dispose should close fastify', { skip: !('asyncDispose' in Symbol) }, async t => {8 t.plan(2)9 10 const fastify = Fastify()11 12 await fastify.listen({ port: 0 })13 14 t.assert.strictEqual(fastify.server.listening, true)15 16 // the same as syntax sugar for17 // await using app = fastify()18 await fastify[Symbol.asyncDispose]()19 t.assert.strictEqual(fastify.server.listening, false)20})21 