feat(@angular-devkit/build-angular): karma-coverage w/ app builder #28509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tasks to Cover (🥁)
istanbul-lib-instrument
and not the one thatkarma-coverage
depends on.Implementation Notes
packages/angular/build/src/tools/babel/plugins/*
are 1:1 copies of files already present inpackages/angular_devkit/build_angular/src/tools/babel/plugins/*
. I couldn't find a clean way to prevent that. Either @angular/build have to expose the plugin inpackage.json#exports
or it would have to depend on @angular-devkit/build-angular. Both seemed undesirable.Historical Notes
Approaches that didn't work:
karma-coverage
really doesn't want to filter data from coverage data after the fact. Not to mention that it could be fairly expensive to send that data back to the karma process if it's then just discarded.karma-coverage
's built-in preprocessor. The outdated instrumentation code it's using doesn't handle async function correctly and gives bad function coverage data because of it.Things that could've worked: