static-cms/packages/core/test/data/config.mock.ts

15 lines
421 B
TypeScript
Raw Normal View History

2023-03-30 13:29:09 -04:00
/* eslint-disable import/prefer-default-export */
2023-05-10 09:09:36 -04:00
import { applyDefaults } from '@staticcms/core/actions/config';
2023-03-30 13:29:09 -04:00
import type { BaseField, Config } from '@staticcms/core';
export const createMockConfig = <EF extends BaseField>(
options: Omit<Partial<Config<EF>>, 'collections'> & Pick<Config<EF>, 'collections'>,
2023-05-10 09:09:36 -04:00
): Config<EF> =>
applyDefaults({
backend: {
name: 'test-repo',
},
...options,
});