add missing shutdown hooks in unit tests
This commit is contained in:
parent
4db8d0b9ed
commit
b8e3f545c0
10 changed files with 55 additions and 12 deletions
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue