1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-15 01:16:22 +02:00
unleash.unleash/src/test/config/test-config.ts
Nuno Góis d696863a51
feat: convert environment actions to a popover menu, add clone option (#2214)
* feat: convert environment actions to a popover menu, add clone option

* add cloneEnviroment feature flag, hide the clone option behind it

* fix: update snap
2022-10-21 08:11:14 +01:00

39 lines
1.2 KiB
TypeScript

import merge from 'deepmerge';
import {
IAuthType,
IUnleashConfig,
IUnleashOptions,
} from '../../lib/types/option';
import getLogger from '../fixtures/no-logger';
import { createConfig } from '../../lib/create-config';
function mergeAll<T>(objects: Partial<T>[]): T {
return merge.all<T>(objects.filter((i) => i));
}
export function createTestConfig(config?: IUnleashOptions): IUnleashConfig {
const testConfig: IUnleashOptions = {
getLogger,
authentication: { type: IAuthType.NONE, createAdminUser: false },
server: { secret: 'really-secret' },
session: { db: false },
versionCheck: { enable: false },
enableOAS: true,
clientFeatureCaching: {
enabled: false,
},
experimental: {
flags: {
embedProxy: true,
embedProxyFrontend: true,
batchMetrics: true,
personalAccessTokens: true,
syncSSOGroups: true,
cloneEnvironment: true,
},
},
};
const options = mergeAll<IUnleashOptions>([testConfig, config]);
return createConfig(options);
}