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,18 +1,19 @@
'use strict'
const t = require('tap')
const test = t.test
const { test } = require('node:test')
const Fastify = require('..')
const Reply = require('../lib/reply')
test('should serialize reply when response stream is ended', t => {
t.plan(3)
test('should serialize reply when response stream is ended', (t, done) => {
t.plan(5)
const stream = require('node:stream')
const fastify = Fastify({
logger: {
serializers: {
res (reply) {
t.type(reply, Reply)
t.assert.strictEqual(reply instanceof Reply, true)
t.assert.ok('passed')
return reply
}
}
@@ -27,11 +28,13 @@ test('should serialize reply when response stream is ended', t => {
reply.raw.end(Buffer.from('hello\n'))
})
t.after(() => fastify.close())
fastify.inject({
url: '/error',
method: 'GET'
}, (err) => {
t.error(err)
fastify.close()
t.assert.ifError(err)
done()
})
})