christophrumpel/missing-livewire-assertions
assertLivewireLoaded(), assertLivewireEmitted(), assertLivewireCalled()). This aligns with Laravel/Livewire applications where testability and reliability of interactive components are critical.Pest/PHPUnit) without modifying core Livewire logic, making it a low-risk addition to the architecture.composer.json to mitigate this.actingAs(), refreshDatabase()).Dependency Addition:
composer require --dev christophrumpel/missing-livewire-assertions
composer.json under require-dev.Test Suite Updates:
use function ChristophRumpel\MissingLivewireAssertions\assertLivewireLoaded;
use ChristophRumpel\MissingLivewireAssertions\AssertsLivewire;
class MyTest extends TestCase {
use AssertsLivewire;
}
Backward Compatibility:
assertComponentRendered()) with the package’s equivalents.assertTrue($component->rendered) with assertLivewireLoaded('my-component').spatie/laravel-livewire). Audit dependencies for overlaps.wire:emit).wire:click).composer update during dependency reviews.assertLivewireEmitted() syntax).composer.lock).assertLivewireCalled('methodName').--parallel) remains unaffected.| Failure Scenario | Mitigation | Detection |
|---|---|---|
| Livewire version incompatibility | Pin Livewire version in composer.json. |
CI build failures. |
| Assertion flakiness (race conditions) | Use waitFor() or sleep() sparingly in tests. |
Failing tests with inconsistent logs. |
| Over-reliance on package assertions | Maintain hybrid tests (custom + package assertions) for critical paths. | Code review. |
| Package abandonment | Fork the package if maintenance stops (MIT license allows this). | Monitor GitHub activity. |
How can I help you explore Laravel packages today?