Skip to content

Commit

Permalink
fix: decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
climba03003 committed Oct 7, 2024
1 parent bcd7ec1 commit cb6911f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/multipart/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const plugin: FastifyPluginAsync<FastifyMultipartOption> = async function (fasti
throw FST_MP_CONFLICT_CONFIG()
}

fastify.decorateRequest(kAdapter, null)
fastify.decorateRequest(kStorage, null)
fastify.decorateRequest(kAdapter)
fastify.decorateRequest(kStorage)
fastify.decorateRequest(kIsMultipart, false)
fastify.decorateRequest(kIsMultipartParsed, false)
fastify.decorateRequest('files', null)
Expand Down
2 changes: 1 addition & 1 deletion packages/multipart/test/create-fastify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function createFastify (t: TestContext, options?: FastifyMultipartO
const inline = parseMode.inline ?? false
const iterator = parseMode.iterator ?? false
const formData = parseMode.formData ?? false
const fastify = Fastify(fastifyOptions)
const fastify = Fastify({ ...fastifyOptions })

await fastify.register(FastifyMultipart, options)

Expand Down
8 changes: 4 additions & 4 deletions packages/multipart/test/warning.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { request } from './request'

test('multipart already parsed', async function (t) {
t.test('addHook', async function (t) {
const fastify = Fastify(fastifyOptions)
const fastify = Fastify({ ...fastifyOptions })

t.after(async function () {
await fastify.close()
Expand Down Expand Up @@ -57,7 +57,7 @@ test('multipart already parsed', async function (t) {
})

t.test('parseMultipart', async function (t) {
const fastify = Fastify(fastifyOptions)
const fastify = Fastify({ ...fastifyOptions })

t.after(async function () {
await fastify.close()
Expand Down Expand Up @@ -104,7 +104,7 @@ test('multipart already parsed', async function (t) {

t.test('multipart', async function (t) {
const ok: typeof t.ok = t.ok
const fastify = Fastify(fastifyOptions)
const fastify = Fastify({ ...fastifyOptions })

t.after(async function () {
await fastify.close()
Expand Down Expand Up @@ -154,7 +154,7 @@ test('multipart already parsed', async function (t) {

t.test('formData', async function (t) {
const ok: typeof t.ok = t.ok
const fastify = Fastify(fastifyOptions)
const fastify = Fastify({ ...fastifyOptions })

t.after(async function () {
await fastify.close()
Expand Down

0 comments on commit cb6911f

Please sign in to comment.