Skip to content

feat(@schematics/angular): add migrate-karma-to-vitest update migration - #32936

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:vitest/karma-migration
Apr 7, 2026
Merged

feat(@schematics/angular): add migrate-karma-to-vitest update migration#32936
clydin merged 1 commit into
angular:mainfrom
clydin:vitest/karma-migration

Conversation

@clydin

@clydin clydin commented Apr 3, 2026

Copy link
Copy Markdown
Member

Migrate projects using the Karma unit-test builder to the new @angular/build:unit-test builder with Vitest.

This migration automatically updates target builders, translates builder options (such as coverage and browsers format), moves custom build options to dedicated configurations to prevent loss of custom settings, cleans up default configuration files, and installs required Vitest runner packages.

@clydin clydin added the target: major This PR is targeted for the next major release label Apr 3, 2026
@angular-robot angular-robot Bot added detected: feature PR contains a feature commit area: @schematics/angular labels Apr 3, 2026
@clydin
clydin force-pushed the vitest/karma-migration branch 6 times, most recently from 0e6efbc to 9d71be1 Compare April 6, 2026 17:26
@clydin
clydin marked this pull request as ready for review April 6, 2026 17:59

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new schematic to migrate Angular projects from the legacy Karma unit-test builder to the new Vitest-based unit-test builder. The changes include logic to map Karma configurations, coverage settings, and build options to the new builder, along with necessary dependency updates. Feedback was provided regarding potential configuration overwrites when processing build options, the risk of duplicate entries in the setupFiles array, and the recommendation to use node:util's isDeepStrictEqual instead of JSON.stringify for robust object comparison.

Comment thread packages/schematics/angular/migrations/migrate-karma-to-vitest/migration.ts Outdated
Comment thread packages/schematics/angular/migrations/migrate-karma-to-vitest/migration.ts Outdated
Comment thread packages/schematics/angular/migrations/migrate-karma-to-vitest/migration.ts Outdated
@clydin
clydin force-pushed the vitest/karma-migration branch 4 times, most recently from 4dbaed6 to 20e9848 Compare April 6, 2026 22:06
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Apr 7, 2026
Comment thread packages/schematics/angular/migrations/migrate-karma-to-vitest/migration.ts Outdated

@alan-agius4 alan-agius4 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just a NIT

Migrate projects using the Karma unit-test builder to the new
@angular/build:unit-test builder with Vitest.

This migration automatically updates target builders, translates builder options
(such as coverage and browsers format), moves custom build options to dedicated
configurations to prevent loss of custom settings, cleans up default
configuration files, and installs required Vitest runner packages.
@clydin
clydin force-pushed the vitest/karma-migration branch from 20e9848 to e80aa3e Compare April 7, 2026 13:51
@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 Apr 7, 2026
@clydin
clydin merged commit be60a63 into angular:main Apr 7, 2026
36 checks passed
@clydin

clydin commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

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

@clydin
clydin deleted the vitest/karma-migration branch April 7, 2026 14:41
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 May 8, 2026
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: @schematics/angular 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