mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 00:15:35 +02:00
refactor: ファイルアップロード時のテストを追加 (#15928)
* refactor: ファイルアップロード時のテストを追加 * なぜかsemverが消えてた
This commit is contained in:
@@ -7,7 +7,7 @@ import cluster from 'node:cluster';
|
||||
import * as fs from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';
|
||||
import Fastify, { FastifyInstance } from 'fastify';
|
||||
import Fastify, { type FastifyInstance } from 'fastify';
|
||||
import fastifyStatic from '@fastify/static';
|
||||
import fastifyRawBody from 'fastify-raw-body';
|
||||
import { IsNull } from 'typeorm';
|
||||
@@ -309,6 +309,13 @@ export class ServerService implements OnApplicationShutdown {
|
||||
await this.#fastify.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Fastify instance for testing.
|
||||
*/
|
||||
public get fastify(): FastifyInstance {
|
||||
return this.#fastify;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
async onApplicationShutdown(signal: string): Promise<void> {
|
||||
await this.dispose();
|
||||
|
||||
@@ -61,6 +61,7 @@ export const meta = {
|
||||
message: 'Cannot upload the file because it exceeds the maximum file size.',
|
||||
code: 'MAX_FILE_SIZE_EXCEEDED',
|
||||
id: 'b9d8c348-33f0-4673-b9a9-5d4da058977a',
|
||||
httpStatusCode: 413,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user