import type { PluginFn } from '@japa/runner/types'; import type { ApplicationService } from '@adonisjs/core/types'; import type Livewire from '../../livewire.js'; /** * Japa plugin to add Livewire component testing support * * This plugin exposes the real `Livewire` singleton instance as a `livewire` * testing helper in the test context, allowing direct component testing * similar to PHP Livewire's `Livewire::test()`. * * @example * ```ts * // tests/bootstrap.ts * import { livewireTesting } from 'adonisjs-livewire/plugins/japa/testing' * * export const plugins: Config['plugins'] = [ * livewireTesting(app), * ] * ``` * * @example * ```ts * // tests/unit/counter.spec.ts * import Counter from '#livewire/counter' * * test('can increment count', async ({ livewire }) => { * await livewire * .test(Counter, {}) * .call('increment') * .assertSet('count', 1) * }) * ``` */ export declare function livewireTesting(app: ApplicationService): PluginFn; /** * Augment the Japa TestContext to include the real Livewire instance */ declare module '@japa/runner/core' { interface TestContext { livewire: Livewire; } }