mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): domain and infra modules (#6301)
This commit is contained in:
parent
26e6602ed3
commit
12dc7c48c9
9 changed files with 39 additions and 47 deletions
|
|
@ -47,7 +47,6 @@ export default async () => {
|
|||
}
|
||||
|
||||
process.env.NODE_ENV = 'development';
|
||||
process.env.IMMICH_TEST_ENV = 'true';
|
||||
process.env.IMMICH_CONFIG_FILE = path.normalize(`${__dirname}/immich-e2e-config.json`);
|
||||
process.env.TZ = 'Z';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import { AssetCreate, IJobRepository, JobItem, JobItemHandler, LibraryResponseDto, QueueName } from '@app/domain';
|
||||
import { AppModule } from '@app/immich';
|
||||
import { dataSource } from '@app/infra';
|
||||
import { InfraModule, InfraTestModule, dataSource } from '@app/infra';
|
||||
import { AssetEntity, AssetType, LibraryType } from '@app/infra/entities';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
|
||||
import { randomBytes } from 'crypto';
|
||||
import * as fs from 'fs';
|
||||
import { DateTime } from 'luxon';
|
||||
|
|
@ -69,6 +68,8 @@ export const testApp = {
|
|||
const { jobs } = options || { jobs: false };
|
||||
|
||||
const moduleFixture = await Test.createTestingModule({ imports: [AppModule], providers: [AppService] })
|
||||
.overrideModule(InfraModule)
|
||||
.useModule(InfraTestModule)
|
||||
.overrideProvider(IJobRepository)
|
||||
.useValue({
|
||||
addHandler: (_queueName: QueueName, _concurrency: number, handler: JobItemHandler) => (_handler = handler),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue