Skip to content

Component not found phpunit #43

@uchajk

Description

@uchajk

Component not found phpunit.

[2023-01-10 16:25:54] testing.ERROR: Unable to find component: [export-button] {"userId":1,"exception":"[object] (Livewire\\Exceptions\\ComponentNotFoundException(code: 0): Unable to find component: [export-button] at /Users/ucha/www/project/vendor/livewire/livewire/src/LivewireManager.php:75) [stacktrace]

I believe the problem is caused by
if (! $this->app->runningInConsole()) { Livewire::component('export-button', ExportButtonComponent::class); } in https://github.com/yajra/laravel-datatables-export/blob/master/src/ExportServiceProvider.php

I guess my question is, why only register the component when not running in console?
And if there is a good reason behind it, how would I go about registering the component when running a test?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions