add missing shutdown hooks in unit tests

This commit is contained in:
Hazelnoot 2025-09-27 20:08:51 -04:00
parent 4db8d0b9ed
commit b8e3f545c0
10 changed files with 55 additions and 12 deletions

View file

@ -4,22 +4,28 @@
*/
import * as assert from 'assert';
import { Test } from '@nestjs/testing';
import { Test, TestingModule } from '@nestjs/testing';
import { CoreModule } from '@/core/CoreModule.js';
import { ReactionService } from '@/core/ReactionService.js';
import { GlobalModule } from '@/GlobalModule.js';
describe('ReactionService', () => {
let app: TestingModule;
let reactionService: ReactionService;
beforeAll(async () => {
const app = await Test.createTestingModule({
app = await Test.createTestingModule({
imports: [GlobalModule, CoreModule],
}).compile();
app.enableShutdownHooks();
reactionService = app.get<ReactionService>(ReactionService);
});
afterAll(async () => {
await app.close();
});
describe('normalize', () => {
test('絵文字リアクションはそのまま', async () => {
assert.strictEqual(await reactionService.normalize('👍'), '👍');