MCPcopy
hub / github.com/ionic-team/capacitor / mockAndroidPlugin

Function mockAndroidPlugin

core/src/tests/plugin.spec.ts:340–353  ·  view source on GitHub ↗
(pluginClassName: string, methodName: string)

Source from the content-addressed store, hash-verified

338 };
339
340 const mockAndroidPlugin = (pluginClassName: string, methodName: string) => {
341 const w: any = win;
342 w.Capacitor = w.Capacitor ?? {};
343 w.Capacitor.PluginHeaders = w.Capacitor.PluginHeaders ?? [];
344 w.Capacitor.PluginHeaders.push({
345 name: pluginClassName,
346 methods: [
347 { name: methodName, rtype: 'promise' },
348 { name: 'addListener' },
349 { name: 'removeListener' },
350 { name: 'removeAllListeners' },
351 ],
352 });
353 };
354});
355
356interface AwesomePlugin extends Plugin {

Callers 1

plugin.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected