mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
26 lines
706 B
TypeScript
26 lines
706 B
TypeScript
import { ImmichEnvironment } from 'src/enum';
|
|
import { EnvData, IConfigRepository } from 'src/interfaces/config.interface';
|
|
import { DatabaseExtension } from 'src/interfaces/database.interface';
|
|
import { Mocked, vitest } from 'vitest';
|
|
|
|
const envData: EnvData = {
|
|
port: 3001,
|
|
environment: ImmichEnvironment.PRODUCTION,
|
|
|
|
database: {
|
|
skipMigrations: false,
|
|
vectorExtension: DatabaseExtension.VECTORS,
|
|
},
|
|
|
|
storage: {
|
|
ignoreMountCheckErrors: false,
|
|
},
|
|
};
|
|
|
|
export const newConfigRepositoryMock = (): Mocked<IConfigRepository> => {
|
|
return {
|
|
getEnv: vitest.fn().mockReturnValue(envData),
|
|
};
|
|
};
|
|
|
|
export const mockEnvData = (config: Partial<EnvData>) => ({ ...envData, ...config });
|