Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function mockPlug(
slotName: string,
component: PlugComponentType
) {
const name = getNewPluginName();
const testPlugin = createPlugin({ name });
testPlugin.plug(slotName, component);
testPlugin.register();
}
export function getMethodsOf(
pluginName: Spec['name']
) {
const name = getNewPluginName();
createPlugin({ name }).register();
return getPluginContext(name).getMethodsOf(pluginName);
}
export function on(
pluginName: Spec['name'],
handlers: EventHandlers
) {
const name = getNewPluginName();
const testPlugin = createPlugin({ name });
testPlugin.on(pluginName, handlers);
testPlugin.register();
}