-
-
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
Assertion Tests & Implementation #51
Conversation
Thanks for this @Juhlinus, but I actually have some updated testing helpers. I'm going to leave this PR open and will post those helpers when I have a minute. |
Great! Looking forward to it! |
i am curious about these new helpers too @reinink |
@herpaderpaldent Jonathan has a day-job and can't push out new changes everyday, unfortunately. He will post an update in this thread when the new helpers are available. :) |
This would probably make better sense as a trait instead of a class? |
it would be nice! I do prefer strategy proposed by @Juhlinus insted of traits, because we get autocompletion advantage. It will require one single change on your app codebase base ( |
IMHO better to create a proper mixin class and boot in the service provider or when needed TestResponse::mixin(new TestMixins); |
Macros would be a option. But auto completion would be a plus! |
But what if the user already has his own Maybe a trait or macro would be a better option. |
Hi there. any updates on this ? |
@mojtabaahn Not yet! If you want to use it, then just add it to your project. 😄 |
While I wait for the PR to be merged, I'm doing something like that:
Thanks for the idea @Juhlinus |
Assertions in the Inertia Laravel Adapter
I'm pretty sure that most of us that are testing are making use of the neat macros that was made for PingCRM, so I thought I'd make a PR merging those assertions into the adapter.
Motivations
I don't really want my TestCase.php to be bloated with a ton of macros, so I decided to make these assertions and override the default Laravel TestResponse with these. (You will of course be able to use all assertions that comes with Laravel as well.)
Usage
Simply extend the Inertia TestCase instead of the default Laravel one.
Before
After
See? Much cleaner than before!
Docs
If this get merged I'll sit down and write some documentation for this as well. 😄