24 lines
686 B
TypeScript
Raw Permalink 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';
import type { BaseField, Config, ConfigWithDefaults } from '@staticcms/core';
export const createNoDefaultsMockConfig = <EF extends BaseField>(
options: Omit<Partial<Config<EF>>, 'collections'> & Pick<Config<EF>, 'collections'>,
): Config<EF> => ({
backend: {
name: 'test-repo',
},
...options,
});
2023-03-30 13:29:09 -04:00
export const createMockConfig = <EF extends BaseField>(
options: Omit<Partial<Config<EF>>, 'collections'> & Pick<Config<EF>, 'collections'>,
): ConfigWithDefaults<EF> =>
2023-05-10 09:09:36 -04:00
applyDefaults({
backend: {
name: 'test-repo',
},
...options,
});