UNPKG

@contract-case/case-plugin-base

Version:

Plugin framework for writing plugins for the ContractCase test framework

22 lines 1.13 kB
import { PluginDescription } from '../types'; import { DataContext } from './types'; /** * Gets the plugin configuration (the mockConfig object keyed by your plugin * short name) for the given plugin. This function validates the context and * throws {@link CaseConfigurationError} if the mockConfig object is not set * or the key is missing. You don't need to catch this exception, you can let * it bubble up to the framework for it to be rendered to the user. * * This function doesn't know the expected shape of your configuration object; * it's up to you to then validate the object has the appropriate fields set * to valid values. * @public * * @param context - the current {@link MatchContext} * @param pluginShortName - the short name for the currently executing plugin * @returns the value of `mockConfig[pluginShortName]` * @throws CaseConfigurationError if the expected configuration keys are not * set, or are set but not defined. */ export declare const getPluginConfig: (context: DataContext, description: PluginDescription) => Record<string, unknown>; //# sourceMappingURL=pluginConfig.d.ts.map