2024-03-20 21:20:38 +01:00
|
|
|
import { SystemConfigCore } from 'src/cores/system-config.core';
|
2024-03-21 12:59:49 +01:00
|
|
|
import { ISystemConfigRepository } from 'src/interfaces/system-config.interface';
|
2024-04-16 16:44:45 +02:00
|
|
|
import { Mocked, vitest } from 'vitest';
|
2023-10-09 02:51:03 +02:00
|
|
|
|
2024-04-16 16:44:45 +02:00
|
|
|
export const newSystemConfigRepositoryMock = (reset = true): Mocked<ISystemConfigRepository> => {
|
2023-10-09 02:51:03 +02:00
|
|
|
if (reset) {
|
|
|
|
SystemConfigCore.reset();
|
|
|
|
}
|
2023-01-21 17:11:55 +01:00
|
|
|
|
|
|
|
return {
|
2024-04-16 16:44:45 +02:00
|
|
|
fetchStyle: vitest.fn(),
|
|
|
|
load: vitest.fn().mockResolvedValue([]),
|
|
|
|
readFile: vitest.fn(),
|
|
|
|
saveAll: vitest.fn().mockResolvedValue([]),
|
|
|
|
deleteKeys: vitest.fn(),
|
2023-01-21 17:11:55 +01:00
|
|
|
};
|
|
|
|
};
|