Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Oct 30, 2025

Updates the application and ng-new schematics to correctly configure Karma-based projects.

  • The test target in the generated angular.json now uses the @angular/build:unit-test builder.
  • The builder options are simplified to only include runner: 'karma', as other settings are now handled by the unified builder.
  • Corresponding schematic tests have been updated to reflect these changes.

@clydin clydin added the target: rc This PR is targeted for the next release-candidate label Oct 30, 2025
@clydin clydin force-pushed the ng-new/karma-runner-new branch 9 times, most recently from ea24c45 to f88a895 Compare October 31, 2025 13:48
… unit-test builder

Updates the application and ng-new schematics to correctly configure Karma-based projects.

- The test target in the generated angular.json now uses the `@angular/build:unit-test` builder.
- The builder options are simplified to only include runner: 'karma', as other settings are now handled by the unified builder.
- Corresponding schematic tests have been updated to reflect these changes.
@clydin clydin force-pushed the ng-new/karma-runner-new branch from f88a895 to c2019d5 Compare October 31, 2025 14:06
…ation

This commit enhances the `config` schematic to provide better guidance and correctness when generating a Karma configuration file.

Changes include:
- The `addKarmaConfig` function now correctly handles projects using the `@angular/build:unit-test` builder.
- When the `unit-test` builder is in use, the schematic checks the `runner` option in both the main `options` and all `configurations` of the `test` target.
- Warnings are issued if the `runner` is not explicitly set to `karma` (defaulting to Vitest) or if it's set to a different runner, informing the user that the generated `karma.conf.js` might not be used.
- Corresponding unit tests have been added to `packages/schematics/angular/config/index_spec.ts` to validate this new warning behavior and ensure correct interaction with the `unit-test` builder.
@clydin clydin force-pushed the ng-new/karma-runner-new branch from ac4b251 to 941c262 Compare October 31, 2025 14:34
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 31, 2025
@clydin clydin requested a review from alan-agius4 October 31, 2025 15:00
@alan-agius4 alan-agius4 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 Nov 4, 2025
@alan-agius4 alan-agius4 merged commit b5f4192 into angular:main Nov 4, 2025
33 checks passed
@alan-agius4
Copy link
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the ng-new/karma-runner-new branch November 4, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @schematics/angular target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants