2024-10-01 12:04:37 -05:00
|
|
|
import { EnvData, IConfigRepository } from 'src/interfaces/config.interface';
|
2024-09-27 09:28:56 -05:00
|
|
|
import { DatabaseExtension } from 'src/interfaces/database.interface';
|
|
|
|
import { Mocked, vitest } from 'vitest';
|
|
|
|
|
2024-10-01 12:04:37 -05:00
|
|
|
const envData: EnvData = {
|
|
|
|
database: {
|
|
|
|
skipMigrations: false,
|
|
|
|
vectorExtension: DatabaseExtension.VECTORS,
|
|
|
|
},
|
|
|
|
storage: {
|
|
|
|
ignoreMountCheckErrors: false,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2024-09-27 09:28:56 -05:00
|
|
|
export const newConfigRepositoryMock = (): Mocked<IConfigRepository> => {
|
|
|
|
return {
|
2024-10-01 12:04:37 -05:00
|
|
|
getEnv: vitest.fn().mockReturnValue(envData),
|
2024-09-27 09:28:56 -05:00
|
|
|
};
|
|
|
|
};
|
2024-10-01 12:04:37 -05:00
|
|
|
|
|
|
|
export const mockEnvData = (config: Partial<EnvData>) => ({ ...envData, ...config });
|