Skip to content

feat: Added support for instrumentForCoverage#1115

Merged
Aukevanoost merged 1 commit into
mainfrom
issues/instrument-for-coverage
Jun 23, 2026
Merged

feat: Added support for instrumentForCoverage#1115
Aukevanoost merged 1 commit into
mainfrom
issues/instrument-for-coverage

Conversation

@Aukevanoost

Copy link
Copy Markdown
Collaborator

This pull request adds support for Istanbul code coverage instrumentation in the application build and serve process, enabling code coverage collection for end-to-end (E2E) tests such as Cypress. The changes introduce new builder options for enabling instrumentation and specifying files to exclude from coverage, and implement the necessary logic to apply these options during the build.

Coverage Instrumentation Support:

  • Introduced two new builder options in schema.json: instrumentForCoverage (boolean flag to enable Istanbul coverage instrumentation) and codeCoverageExclude (array of globs for files to exclude from coverage).
  • Added a new utility module coverage-instrumentation.ts that provides helpers for resolving the instrumentation filter, determining excluded paths, and matching project source roots. This logic is adapted from Angular's internal code coverage support.

Builder Logic Updates:

  • Updated the build process in builder.ts to resolve and apply the instrumentation filter when instrumentForCoverage is enabled, ensuring only the intended files are instrumented for coverage. [1] [2]
  • Refactored the internal application builder logic to accept and propagate the instrumentForCoverage filter, integrating coverage instrumentation seamlessly into both build and serve workflows. [1] [2]

Imports and Integration:

  • Added import for the new resolveInstrumentationFilter utility in the main builder file for use in the build process.

@Aukevanoost Aukevanoost force-pushed the issues/instrument-for-coverage branch from 26a3dc0 to 5e2b71a Compare June 23, 2026 04:14
@Aukevanoost Aukevanoost merged commit 258ddbc into main Jun 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant