refactor: test mocks (#16008)

This commit is contained in:
Jason Rasmussen 2025-02-10 18:47:42 -05:00 committed by GitHub
parent 8794c84e9d
commit 735f8d661e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
74 changed files with 3820 additions and 4043 deletions

View file

@ -13,7 +13,7 @@ import path from 'node:path';
import { SystemConfig } from 'src/config';
import { CLIP_MODEL_INFO, serverVersion } from 'src/constants';
import { ImmichCookie, ImmichHeader, MetadataKey } from 'src/enum';
import { ILoggingRepository } from 'src/types';
import { LoggingRepository } from 'src/repositories/logging.repository';
export class ImmichStartupError extends Error {}
export const isStartUpError = (error: unknown): error is ImmichStartupError => error instanceof ImmichStartupError;
@ -96,7 +96,7 @@ export const isFaceImportEnabled = (metadata: SystemConfig['metadata']) => metad
export const isConnectionAborted = (error: Error | any) => error.code === 'ECONNABORTED';
export const handlePromiseError = <T>(promise: Promise<T>, logger: ILoggingRepository): void => {
export const handlePromiseError = <T>(promise: Promise<T>, logger: LoggingRepository): void => {
promise.catch((error: Error | any) => logger.error(`Promise error: ${error}`, error?.stack));
};