Filament::serving and tests
Hey!
Maybe a stupid question, but how to get the code inside
Filament::serving
running in a Feature test?
For performance reasons, I have some code inside Filament::serving
, for example some Macros like:
When I run now a test, it doesn't find the macro, since the Filament::serving
isn't called at all?4 Replies
Not sure how "safe" that is but maybe
ServingFilament::dispatch()
?Currently, my workaround is
`
Where filamentMacros is the method which is called by serving.
but thats obviously ugly. Dispatching is obviously better, not sure if its the best way π
I don't know if dispatching is better actually... I think in the spirit of only including predictable things in each test, your solution is a bit better π
Maybe
filamentMacros()
could be static, and it could be simplified to FillyServiceProvider::filamentMacros()
Thanks!