- What is claudiodekker/inertia-laravel-testing used for?
- It is a dev-only testing helper for Laravel applications using Inertia.js. It provides a TestResponse macro and an AssertableInertia class so PHPUnit or Pest feature tests can assert Inertia page components, props, URLs, shared data, and partial reloads. It has no production runtime footprint and does not test JavaScript rendering or hydration.
- How do I install inertia-laravel-testing in a Laravel app?
- Install it as a development dependency with composer require --dev claudiodekker/inertia-laravel-testing. The package uses Laravel service-provider auto-discovery, so no manual provider registration is normally required. Then use its assertions inside existing feature tests that make requests to Inertia routes.
- Does this package support current Laravel, PHP, and Inertia versions?
- That is the key risk: the package is archived and its last release was in January 2021. It may not support current Laravel, PHP, or inertia-laravel versions, and there will be no upstream fixes. Check its Composer version constraints against your installed stack before adopting it, and prefer core inertia-laravel helpers when available.
- How do I assert an Inertia page component and props in a Laravel test?
- Make a request to the Inertia route in a PHPUnit or Pest feature test, then chain the package's Inertia assertions on the test response. You can assert the component name, props, URL, and shared data without manually decoding the Inertia payload. If your inertia-laravel version already ships assertInertia, use that instead of adding a second assertion layer.
- What is the difference between this package and inertia-laravel's assertInertia?
- Modern inertia-laravel ships its own assertInertia and testing helpers, making this package redundant in many current stacks. This package was useful when core lacked equivalent server-side component and prop assertions. The main difference today is maintenance and namespace behavior: the package is archived, while core helpers are maintained with inertia-laravel.
- How do I test Inertia partial reloads in Laravel?
- Partial reload assertions check that only the requested props are returned when Inertia sends partial reload headers. This package supports those assertions, but behavior can differ from core helpers, so run your partial-reload tests carefully during migration. Ensure your test requests include the correct Inertia headers and verify both included and excluded props.
- Is claudiodekker/inertia-laravel-testing still maintained?
- No. The repository is archived, the last release was January 2021, and it is maintained by a small team. There will be no upstream compatibility fixes for newer Laravel, PHP, or Inertia versions. Treat it as a stopgap or legacy dev dependency, not a new standard.
- Can I use inertia-laravel-testing with Pest instead of PHPUnit?
- Yes, the package is designed for Laravel feature tests using PHPUnit or Pest. Pest tests can call the same TestResponse assertions through the package's macro and AssertableInertia class. The practical concern is not the test runner but whether your installed inertia-laravel version already provides equivalent core helpers.
- Why am I getting an AssertableInertia class conflict or the wrong class loaded?
- Recent inertia-laravel versions also use the Inertia\Testing\AssertableInertia namespace, so installing this package alongside core can load the wrong class. That can cause confusing test failures even when assertions look correct. Remove direct package imports, standardize on core helpers where possible, and wrap assertions in a base TestCase helper to isolate the dependency.
- Should I remove this package and migrate to core Inertia testing helpers?
- If your inertia-laravel version already provides assertInertia and equivalent helpers, remove the package rather than deepening the dependency. Inventory tests that import its AssertableInertia, replace them with core Inertia\Testing\AssertableInertia where supported, and run the full feature suite, especially partial-reload and shared-prop assertions. Keep any remaining abstraction behind a base TestCase helper so future migration is cheap.