[Bug]: Coverage for Livewire v4 SFC/MFC not working
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start with the Pest configuration extending TestCase and including ../resources/views/**, then reproduce the issue with ./vendor/bin/pest --coverage after creating the Livewire MFC with php artisan make:livewire post.create --mfc --test. Trace how coverage discovers the new component files and compare the result with the tests that run successfully. Done means coverage output includes the newly created Livewire v4 component.
Written by the indexing model from the issue text.
Description
What Happened
Hi everyone, 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 adding the --coverage flag, no information about the coverage is displayed for the new livewire v4 components.
I asked on the livewire repo (see https://github.com/livewire/livewire/discussions/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
- Dominant language
- PHP
- Stars
- 11.7k
- Forks
- 538
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pestphp/pest
-
[Bug]: [mutate] Windows: @pest-mutate-ignore comments land on line 1 in files with LF line endings Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100