2024-05-16 00:58:23 +02:00
|
|
|
import { SystemConfigCore } from 'src/cores/system-config.core';
|
2024-03-21 12:59:49 +01:00
|
|
|
import { ISystemMetadataRepository } from 'src/interfaces/system-metadata.interface';
|
2024-04-16 16:44:45 +02:00
|
|
|
import { Mocked, vitest } from 'vitest';
|
2024-01-04 06:28:32 +01:00
|
|
|
|
2024-05-16 00:58:23 +02:00
|
|
|
export const newSystemMetadataRepositoryMock = (reset = true): Mocked<ISystemMetadataRepository> => {
|
|
|
|
if (reset) {
|
|
|
|
SystemConfigCore.reset();
|
|
|
|
}
|
|
|
|
|
2024-01-04 06:28:32 +01:00
|
|
|
return {
|
2024-04-16 16:44:45 +02:00
|
|
|
get: vitest.fn() as any,
|
|
|
|
set: vitest.fn(),
|
2024-07-01 19:43:16 +02:00
|
|
|
delete: vitest.fn(),
|
2024-05-16 00:58:23 +02:00
|
|
|
readFile: vitest.fn(),
|
2024-01-04 06:28:32 +01:00
|
|
|
};
|
|
|
|
};
|