call app.init, app.enableShutdownHooks, and app.close in more tests

This commit is contained in:
Hazelnoot 2025-10-01 11:54:07 -04:00
parent 7d6732bf96
commit 92892338f3
11 changed files with 66 additions and 53 deletions

View file

@ -149,6 +149,9 @@ describe('AbuseReportNotificationService', () => {
})
.compile();
await app.init();
app.enableShutdownHooks();
usersRepository = app.get(DI.usersRepository);
userProfilesRepository = app.get(DI.userProfilesRepository);
systemWebhooksRepository = app.get(DI.systemWebhooksRepository);
@ -159,8 +162,10 @@ describe('AbuseReportNotificationService', () => {
roleService = app.get(RoleService) as jest.Mocked<RoleService>;
emailService = app.get<EmailService>(EmailService) as jest.Mocked<EmailService>;
webhookService = app.get<SystemWebhookService>(SystemWebhookService) as jest.Mocked<SystemWebhookService>;
});
app.enableShutdownHooks();
afterAll(async () => {
await app.close();
});
beforeEach(async () => {
@ -185,10 +190,6 @@ describe('AbuseReportNotificationService', () => {
await abuseReportNotificationRecipientRepository.delete({});
});
afterAll(async () => {
await app.close();
});
// --------------------------------------------------------------------------------------
describe('createRecipient', () => {