remove inline providers from unit tests
This commit is contained in:
parent
92892338f3
commit
a3e969625d
6 changed files with 33 additions and 76 deletions
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { afterEach, beforeAll, describe, test } from '@jest/globals';
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { DataSource } from 'typeorm';
|
||||
import { CustomEmojiService } from '@/core/CustomEmojiService.js';
|
||||
import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js';
|
||||
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
||||
|
|
@ -17,7 +18,6 @@ import { EmojisRepository } from '@/models/_.js';
|
|||
import { MiEmoji } from '@/models/Emoji.js';
|
||||
import { CoreModule } from '@/core/CoreModule.js';
|
||||
import { DriveService } from '@/core//DriveService.js';
|
||||
import { DataSource } from 'typeorm';
|
||||
|
||||
describe('CustomEmojiService', () => {
|
||||
let app: TestingModule;
|
||||
|
|
@ -33,15 +33,6 @@ describe('CustomEmojiService', () => {
|
|||
GlobalModule,
|
||||
CoreModule,
|
||||
],
|
||||
providers: [
|
||||
CustomEmojiService,
|
||||
UtilityService,
|
||||
IdService,
|
||||
EmojiEntityService,
|
||||
ModerationLogService,
|
||||
GlobalEventService,
|
||||
DriveService,
|
||||
],
|
||||
})
|
||||
.compile();
|
||||
|
||||
|
|
@ -51,7 +42,7 @@ describe('CustomEmojiService', () => {
|
|||
service = app.get<CustomEmojiService>(CustomEmojiService);
|
||||
emojisRepository = app.get<EmojisRepository>(DI.emojisRepository);
|
||||
idService = app.get<IdService>(IdService);
|
||||
await app.get<DataSource>(DI.db).query("set session time zone 'UTC'");
|
||||
await app.get<DataSource>(DI.db).query('set session time zone \'UTC\'');
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue