0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-03-11 02:23:09 -05:00

chore(server): add DB_URL supports Unix sockets unit test (#15629)

* test(server): DB_URL supports Unix sockets

* chore: format

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Robert Schütz 2025-01-25 02:38:00 -08:00 committed by GitHub
parent 79592701dd
commit 947c053c15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -172,6 +172,28 @@ describe('getEnv', () => {
expect(() => getEnv()).toThrowError('Invalid ssl option: invalid');
});
it('should handle socket: URLs', () => {
process.env.DB_URL = 'socket:/run/postgresql?db=database1';
const { database } = getEnv();
expect(database.config.kysely).toMatchObject({
host: '/run/postgresql',
database: 'database1',
});
});
it('should handle sockets in postgres: URLs', () => {
process.env.DB_URL = 'postgres:///database2?host=/path/to/socket';
const { database } = getEnv();
expect(database.config.kysely).toMatchObject({
host: '/path/to/socket',
database: 'database2',
});
});
});
describe('redis', () => {