Skip to content

[Bug]: Coverage for Livewire v4 SFC/MFC not working #1619

@cstisa

Description

@cstisa

What Happened

Hi everone, I migrated my project from livewire v3 to livewire v4, using the brand new structure for components (see https://livewire.laravel.com/docs/4.x/components#multi-file-components).

With the correct configuration, the pest tests are running fine, but addind the --coverage flag, no information about the coverage is displayed for the new livewire v4 components.

I asked on the livewire repo (see livewire/livewire#9601), and they redirected me here to raise an issue about this.

How to Reproduce

Brand new install with Laravel and Livewire v4 (https://livewire.laravel.com/docs/4.x/quickstart).
Then create a component with : php artisan make:livewire post.create --mfc --test
In the pest config, update it with this :

pest()->extend(TestCase::class)
    ->use(RefreshDatabase::class)
    ->in('Feature', 'Unit', '../resources/views/**');

then run you tests with : ./vendor/bin/pest --coverage

You'll see that the coverage for your newly created component is missing but the tests ran well.

Sample Repository

No response

Pest Version

v4.3.1

PHP Version

8.5.1

Operation System

Linux

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions