enzyme-context
Version:
Enzyme Context is a pluggable library which simplifies the process of testing components that rely on react context.
15 lines • 684 B
TypeScript
import { EnzymePlugin } from 'enzyme-context-utils';
export declare type SecondArgument<F> = F extends (arg1: any, arg2: infer T, ...args: any[]) => any ? T : never;
export declare type EnzymePlugins = {
[plugin: string]: EnzymePlugin<any, any>;
};
export declare type GetControllers<P extends EnzymePlugins> = {
[PluginName in keyof P]: ReturnType<P[PluginName]>['controller'];
};
export declare type GetContextWrapper<EW, P extends EnzymePlugins> = EW & GetControllers<P> & {
component: EW;
};
export declare type GetOptions<RP, P extends EnzymePlugins> = RP & {
[PluginName in keyof P]: SecondArgument<P[PluginName]>;
}[keyof P];
//# sourceMappingURL=Types.d.ts.map