mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 17:25:35 +03:00
fix(server): keep system config transformations (#13796)
This commit is contained in:
@@ -237,6 +237,24 @@ describe(SystemConfigService.name, () => {
|
||||
expect(systemMock.readFile).toHaveBeenCalledWith('immich-config.json');
|
||||
});
|
||||
|
||||
it('should transform booleans', async () => {
|
||||
configMock.getEnv.mockReturnValue(mockEnvData({ configFile: 'immich-config.json' }));
|
||||
systemMock.readFile.mockResolvedValue(JSON.stringify({ ffmpeg: { twoPass: 'false' } }));
|
||||
|
||||
await expect(sut.getSystemConfig()).resolves.toMatchObject({
|
||||
ffmpeg: expect.objectContaining({ twoPass: false }),
|
||||
});
|
||||
});
|
||||
|
||||
it('should transform numbers', async () => {
|
||||
configMock.getEnv.mockReturnValue(mockEnvData({ configFile: 'immich-config.json' }));
|
||||
systemMock.readFile.mockResolvedValue(JSON.stringify({ ffmpeg: { threads: '42' } }));
|
||||
|
||||
await expect(sut.getSystemConfig()).resolves.toMatchObject({
|
||||
ffmpeg: expect.objectContaining({ threads: 42 }),
|
||||
});
|
||||
});
|
||||
|
||||
it('should log errors with the config file', async () => {
|
||||
configMock.getEnv.mockReturnValue(mockEnvData({ configFile: 'immich-config.json' }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user