For debugging purpose, I would like to have Telescope record any requests coming from Testing suite. Telescope does not at the moment and I have no ideas why.
I enabled telescope in phpunit.xml
<env name="TELESCOPE_ENABLED" value="true"/>
This is my Feature Test
$this->getJson('/api/vehicle')->assertStatus(401);
When I opened the Telescope, there is no entry for /api/vehicle
saved.
I need to always force Telescope to record in TelescopeServiceProvider
class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
// Telescope::night();
Telescope::filter(function (IncomingEntry $entry) {
if ($this->app->environment('local')) {
return true;
}
if ($this->app->environment('testing')) {
return true;
}
return $entry->isReportableException() ||
$entry->isFailedJob() ||
$entry->isScheduledTask() ||
$entry->hasMonitoredTag();
});
}
And since the telescope frontend is linked to development-database
, the telescope entries recorded during testing
are saved in testing-database
, that explain when I refresh the Telescope front-end (which use development-database
), nothing was shown.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With