refactor(server): system config (#9517)
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
import { SystemConfigCore } from 'src/cores/system-config.core';
|
||||
import { ISystemConfigRepository } from 'src/interfaces/system-config.interface';
|
||||
import { Mocked, vitest } from 'vitest';
|
||||
|
||||
export const newSystemConfigRepositoryMock = (reset = true): Mocked<ISystemConfigRepository> => {
|
||||
if (reset) {
|
||||
SystemConfigCore.reset();
|
||||
}
|
||||
|
||||
return {
|
||||
fetchStyle: vitest.fn(),
|
||||
load: vitest.fn().mockResolvedValue([]),
|
||||
readFile: vitest.fn(),
|
||||
saveAll: vitest.fn().mockResolvedValue([]),
|
||||
deleteKeys: vitest.fn(),
|
||||
};
|
||||
};
|
||||
@@ -1,9 +1,16 @@
|
||||
import { SystemConfigCore } from 'src/cores/system-config.core';
|
||||
import { ISystemMetadataRepository } from 'src/interfaces/system-metadata.interface';
|
||||
import { Mocked, vitest } from 'vitest';
|
||||
|
||||
export const newSystemMetadataRepositoryMock = (): Mocked<ISystemMetadataRepository> => {
|
||||
export const newSystemMetadataRepositoryMock = (reset = true): Mocked<ISystemMetadataRepository> => {
|
||||
if (reset) {
|
||||
SystemConfigCore.reset();
|
||||
}
|
||||
|
||||
return {
|
||||
get: vitest.fn() as any,
|
||||
set: vitest.fn(),
|
||||
readFile: vitest.fn(),
|
||||
fetchStyle: vitest.fn(),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user