forked from openmrs/openmrs-esm-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmock.ts
36 lines (26 loc) · 980 Bytes
/
mock.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { createGlobalStore } from '@openmrs/esm-state/mock';
import * as utils from '@openmrs/esm-utils';
export { validators, validator } from './src/index';
export const configInternalStore = createGlobalStore('config-internal', {});
export const implementerToolsConfigStore = createGlobalStore('implementer-tools-config', {});
export const temporaryConfigStore = createGlobalStore('temporary-config', {});
export enum Type {
Array = 'Array',
Boolean = 'Boolean',
ConceptUuid = 'ConceptUuid',
Number = 'Number',
Object = 'Object',
String = 'String',
UUID = 'UUID',
}
export let configSchema = {};
export const getConfig = jest
.fn()
.mockImplementation(() => Promise.resolve(utils.getDefaultsFromConfigSchema(configSchema)));
export function defineConfigSchema(moduleName, schema) {
configSchema = schema;
}
export function defineExtensionConfigSchema(extensionName, schema) {
configSchema = schema;
}
export const clearConfigErrors = jest.fn();