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

@ -6,7 +6,7 @@ process.env.NODE_ENV = 'test';
import * as assert from 'assert';
import { generateKeyPair } from 'crypto';
import { Test } from '@nestjs/testing';
import { Test, TestingModule } from '@nestjs/testing';
import { jest } from '@jest/globals';
import { NoOpCacheService } from '../misc/noOpCaches.js';
@ -94,6 +94,7 @@ async function createRandomRemoteUser(
}
describe('ActivityPub', () => {
let app: TestingModule;
let userProfilesRepository: UserProfilesRepository;
let imageService: ApImageService;
let noteService: ApNoteService;
@ -147,7 +148,7 @@ describe('ActivityPub', () => {
}
beforeAll(async () => {
const app = await Test.createTestingModule({
app = await Test.createTestingModule({
imports: [GlobalModule, CoreModule],
})
.overrideProvider(DownloadService).useValue({
@ -187,6 +188,10 @@ describe('ActivityPub', () => {
resolver.clear();
});
afterAll(async () => {
await app.close();
});
describe('Parse minimum object', () => {
const actor = createRandomActor();