First commit

This commit is contained in:
2026-01-12 13:12:46 +01:00
parent b2d9501f6d
commit a1fbd8acf5
4413 changed files with 1245183 additions and 0 deletions

38
node_modules/fastify/test/request.deprecated.test.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
'use strict'
// Tests for some deprecated `request.*` keys. This file should be
// removed when the deprecation is complete.
process.removeAllListeners('warning')
const test = require('tap').test
const Fastify = require('../')
test('Should expose router options via getters on request and reply', t => {
t.plan(7)
const fastify = Fastify()
const expectedSchema = {
params: {
id: { type: 'integer' }
}
}
fastify.get('/test/:id', {
schema: expectedSchema
}, (req, reply) => {
t.equal(req.routeConfig.url, '/test/:id')
t.equal(req.routeConfig.method, 'GET')
t.same(req.routeSchema, expectedSchema)
t.equal(req.routerPath, '/test/:id')
t.equal(req.routerMethod, 'GET')
reply.send()
})
fastify.inject({
method: 'GET',
url: '/test/123456789'
}, (error, res) => {
t.error(error)
t.equal(res.statusCode, 200)
})
})