-
-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge inertia-laravel-testing into inertia-laravel #220
Conversation
No longer needed since inertiajs/inertia-laravel#220
@claudiodekker hi! thanks for this! how do you use this? I looked at the tests directory and tried to recreate something very simple but keep getting: namespace Tests\Feature\Frontend\Pages;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Inertia\Testing\Assert;
use Tests\TestCase;
class HomePageTest extends TestCase
{
use RefreshDatabase;
/** @test */
function i_can_see_the_homepage()
{
$response = $this->get(route('home'));
$response->assertInertia(fn (Assert $inertia) => $inertia
->component('Home')
);
}
} |
ouuu I didn't notice that this had just been merged! talk about timing! i upgraded this package via composer and my test passed |
Right now, we don't have documentation for this on our website yet, but since this is pretty much entirely the 'old' testing helpers library, you can find the documentation here |
Can we port the testing documentation somewhere more noticeable? Being laravel specific doesn't make sense on the main inertia docs to me personally but in the readme maybe or wiki (which seems to exist but if I click github just redirects back to the main page)? |
The documentation for this seems to be quite hidden 😅 Found some under https://inertiajs.com/releases/inertia-laravel-0.4.0-2021-03-02#top that redirected me to https://github.com/claudiodekker/inertia-laravel-testing/tree/a5ac8d372e456534f5ad2e07a6875e0f27c6a73d. |
@sebastiaanluca Yeah, this really needs more attention. I just haven't had the time to get this done yet. To help things a little, I've just added a new "Testing" page to the website (https://inertiajs.com/testing), which outlines some testing basis, and mentions the Laravel testing helper. |
@reinink Totally understand that! Thanks for adding the docs on testing on such short notice. Think that's enough for (new) Inertia users to get started with testing. |
@reinink do you have something in mind for how you'd like these docs to be implemented? I have some free time these days and may be able to lend a hand. |
@sagalbot Heh, no, I haven't had a chance to think that through yet. It's kind of tricky, as it requires a ton of documentation. It would looks something like the new Fluent JSON Testing Laravel docs and the existing docs that Claudio wrote for this. If you're still up to taking a crack at this, I'd be happy to give you access to the website repo. Let me know. 👍 |
Testing
After multiple months of beta testing, this PR makes the inertia-laravel-testing library an official part of the inertia-laravel adapter 🎉
While the inertia-laravel-testing library WILL remain available for installation, it WILL NOT receive any further (security) updates going forward.
Migrating
To migrate from
inertia-laravel-testing
to theinertia-laravel
adapter implementation, simply follow these easy steps:composer.json
file, remove theclaudiodekker/inertia-laravel-testing
dependency linecomposer.json
file, change the version ofinertiajs/inertia-laravel
to^0.4.0
composer update
use ClaudioDekker\Inertia\Assert;
withuse Inertia\Testing\Assert;
in your test suites.That's it! When done correctly, all of your tests should still be passing.