capell-app/pest-plugin-blade-coverage
A Pest plugin that adds Blade template coverage to Laravel test suites, helping you identify which view files are exercised by tests and where untested Blade code remains.
Package classification: Developer-tooling / test-instrumentation package. It extends Blade rendering with coverage capture and publishes results through the existing test runner. It is a dev-only dependency and does not belong on a production autoload path.
Architecture fit: Good, with caveats. The package is a thin plugin over Laravel's view compiler and the PHPUnit/Pest coverage pipeline rather than a framework fork, so it should slot in without touching application code. The v0.1.3 change is configuration-surface work, not architectural: it formalises resources/views as the default root and adds an explicit opt-in for monorepo layouts. That is the correct default for standard Laravel skeletons and confirms the package expects a conventional app structure.
Integration feasibility: Straightforward for a single-app repo — composer require --dev, config publish, run the suite with a coverage driver (Xdebug or PCOV) enabled. Two friction points remain unproven: (1) whether the coverage driver requirement conflicts with the existing CI job's driver choice, and (2) whether the plugin instruments compiled Blade output and maps it back to .blade.php source, which is the technically hard part and the thing that determines whether the numbers are trustworthy.
Technical risk: Elevated, but bounded to CI rather than runtime.
resources/views assumption is wrong for monorepos. Misconfigured roots are the most likely source of silent zero-coverage results rather than loud errors.Key questions:
.blade.php source lines, and how are @include, @component, and anonymous-component partials attributed — to the parent or the partial?resources/views?Stack fit: Good for a standard Laravel monolith or a modular Laravel app with conventional view roots. The default resources/views behaviour means near-zero configuration for the common case, which lowers the cost of a trial. The monorepo opt-in makes the package usable in a workspace layout without forking, but it shifts configuration burden onto the adopting team — each package's view root must be declared and kept in sync as the workspace evolves.
Migration path: Greenfield, additive, and reversible. Nothing to migrate. Adopt as a dev dependency, keep it out of the production image, and gate the whole thing behind a CI job that can be deleted in one commit. There is no data migration, no runtime surface, and no consumer-facing change, so the blast radius of a bad experience is a red CI job and an afternoon lost.
Compatibility: The open risk. Verify against the actual project matrix before committing: Laravel major version, PHP minor, PHPUnit/Pest version, and whether CI runs Xdebug, PCOV, or neither. PCOV is materially faster and is the pragmatic choice if the plugin supports it. Also confirm the package does not conflict with an existing coverage configuration in phpunit.xml — two tools competing for the same coverage filter is a common and confusing failure.
Sequencing:
Maintenance: Low ongoing effort, but non-zero version-chasing. Being pre-1.0, pin the exact version and treat upgrades as reviewed changes requiring a CI run, not routine composer update churn. Budget a small recurring cost each Laravel or PHPUnit major bump — the view compiler and coverage APIs are the two things most likely to break this package. Single-maintainer or small-team risk is the principal sustainability concern; if the package stalls, the fallback is to remove the dev dependency, which is cheap.
Support: Community-only, expected for a v0.1.x tooling package. There is no vendor SLA and no realistic path to one. Internal ownership should sit with whoever owns the test suite and CI, not with application teams. Document the config keys in the repo's own README so knowledge does not live with one engineer.
Scaling: The main cost is CI compute, not runtime — the package has no production footprint, which is its best operational property. Coverage instrumentation typically multiplies suite time; on a large view count, expect a meaningful increase and plan to run this in a dedicated job rather than bolted onto the primary test run. Memory is the more likely ceiling: instrumenting hundreds of compiled views can be heavy, so watch for OOM on large suites and consider sharding. In a monorepo the cost scales with the number of declared view roots, so the opt-in list is also a cost driver.
Failure modes to watch:
@include with variable names, or views registered from non-standard paths may be invisible to the collector, producing misleading gaps.phpunit.xml coverage config fighting over the same source set.Ramp-up: Low for setup, moderate for interpretation. Any Laravel developer can install and run it in under an hour. The harder skill is reading Blade coverage honestly: understanding that a 100% figure on a layout template is not the same signal as 100% on a form partial, and that partials attributed to parents can inflate or deflate the picture. Plan a short walkthrough with the team on what the number does and does not mean before it becomes a gate. Budget roughly one engineer-day for the spike plus a half-day of documentation; everything after that is CI configuration.
How can I help you explore Laravel packages today?