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

@ -5,22 +5,28 @@
import * as assert from 'assert';
import * as mfm from 'mfm-js';
import { Test } from '@nestjs/testing';
import { Test, TestingModule } from '@nestjs/testing';
import { CoreModule } from '@/core/CoreModule.js';
import { MfmService } from '@/core/MfmService.js';
import { GlobalModule } from '@/GlobalModule.js';
describe('MfmService', () => {
let app: TestingModule;
let mfmService: MfmService;
beforeAll(async () => {
const app = await Test.createTestingModule({
app = await Test.createTestingModule({
imports: [GlobalModule, CoreModule],
}).compile();
app.enableShutdownHooks();
mfmService = app.get<MfmService>(MfmService);
});
afterAll(async () => {
await app.close();
});
describe('toHtml', () => {
test('br', () => {
const input = 'foo\nbar\nbaz';