Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Sep 15, 2025

This change enhances the reporters option in the unit-test builder to support passing an options object, similar to the existing codeCoverageReporters option. Users can now specify a reporter as a tuple of [name, options].

  • The schema.json is updated to allow either a string or a [string, object] tuple in the reporters array. An enum is provided for common reporters while still allowing custom string paths.
  • The option normalization logic in options.ts is refactored into a shared helper function to handle both reporters and codeCoverageReporters, reducing code duplication.
  • The Karma runner, which does not support reporter options, is updated to safely ignore them and warn the user.

@clydin clydin added the target: major This PR is targeted for the next major release label Sep 15, 2025
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: @angular/build labels Sep 15, 2025
This change enhances the `reporters` option in the unit-test builder to support passing an options object, similar to the existing `codeCoverageReporters` option. Users can now specify a reporter as a tuple of `[name, options]`.

- The `schema.json` is updated to allow either a string or a `[string, object]` tuple in the `reporters` array. An `enum` is provided for common reporters while still allowing custom string paths.
- The option normalization logic in `options.ts` is refactored into a shared helper function to handle both `reporters` and `codeCoverageReporters`, reducing code duplication.
- The Karma runner, which does not support reporter options, is updated to safely ignore them and warn the user.
@clydin clydin force-pushed the unit-test/reporter-options branch from f24156f to 378b40a Compare September 15, 2025 20:14
@clydin clydin marked this pull request as ready for review September 15, 2025 20:15
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 15, 2025
@clydin clydin added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 15, 2025
@clydin clydin merged commit 66dd6dd into angular:main Sep 15, 2025
34 checks passed
@clydin clydin deleted the unit-test/reporter-options branch September 15, 2025 21:02
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build detected: feature PR contains a feature commit target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants