Auto-commit 2026-04-29 16:31

This commit is contained in:
2026-04-29 16:31:27 -04:00
parent e8687bb6b2
commit 0495ee5bd2
19691 changed files with 3272886 additions and 138 deletions

41
node_modules/fastify/test/internals/all.test.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
'use strict'
const t = require('tap')
const test = t.test
const Fastify = require('../..')
const { supportedMethods } = require('../../lib/httpMethods')
test('fastify.all should add all the methods to the same url', t => {
const requirePayload = [
'POST',
'PUT',
'PATCH'
]
t.plan(supportedMethods.length * 2)
const fastify = Fastify()
fastify.all('/', (req, reply) => {
reply.send({ method: req.raw.method })
})
supportedMethods.forEach(injectRequest)
function injectRequest (method) {
const options = {
url: '/',
method
}
if (requirePayload.includes(method)) {
options.payload = { hello: 'world' }
}
fastify.inject(options, (err, res) => {
t.error(err)
const payload = JSON.parse(res.payload)
t.same(payload, { method })
})
}
})