mirror of
https://github.com/immich-app/immich.git
synced 2025-01-09 05:16:47 +01:00
92972ac776
* refactor: api keys * refactor: test module * chore: tests * chore: fix provider * refactor: test mock repos
9 lines
363 B
TypeScript
9 lines
363 B
TypeScript
import { ICryptoRepository } from '../src';
|
|
|
|
export const newCryptoRepositoryMock = (): jest.Mocked<ICryptoRepository> => {
|
|
return {
|
|
randomBytes: jest.fn().mockReturnValue(Buffer.from('random-bytes', 'utf8')),
|
|
compareSync: jest.fn().mockReturnValue(true),
|
|
hash: jest.fn().mockImplementation((input) => Promise.resolve(`${input} (hashed)`)),
|
|
};
|
|
};
|