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:

Field::macro("onlyOnEdit", fn() => $this->hidden(fn($record) => !$record || !$record->exists));


When I run now a test, it doesn't find the macro, since the Filament::serving isn't called at all?
Was this page helpful?