Blade View Coverage
Capell uses capell-app/pest-plugin-blade-coverage to check package Blade views separately from PHP line coverage. PHP coverage intentionally ignores resources/views, so this plugin records views that Laravel actually renders during Pest runs.
The check is ratcheted. Existing uncovered views are stored in tests/BladeCoverage/baseline.json with content hashes. CI fails when a new package view is not rendered by tests, or when an existing uncovered view changes without gaining render coverage.
Commands
Section titled “Commands”Run the Blade view coverage gate:
composer coverage:bladeRefresh the baseline after intentionally accepting current uncovered views:
vendor/bin/pest --blade-coverage --blade-coverage-update-baseline --parallel --configuration=phpunit.xmlThe config lives at tests/blade-coverage.php and currently targets:
packages/*/resources/views/**/*.blade.phpExpectations
Section titled “Expectations”- Prefer route, Livewire, or direct view tests that render the Blade file.
- Includes, partials, and component views count when Laravel renders them.
- Source-only assertions with
file_get_contents()do not count as coverage. - Do not add broad excludes for hard-to-test views. Keep the baseline as the ratchet and add focused tests when changing views.