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