Skip to content

fix(@schematics/angular): support testRunner option in library schematic#31893

Merged
alan-agius4 merged 3 commits intoangular:mainfrom
alan-agius4:schematics-vitest
Nov 20, 2025
Merged

fix(@schematics/angular): support testRunner option in library schematic#31893
alan-agius4 merged 3 commits intoangular:mainfrom
alan-agius4:schematics-vitest

Conversation

@alan-agius4
Copy link
Copy Markdown
Collaborator

This commit introduces the testRunner option to the library schematic, allowing users to explicitly select between vitest and karma as their test runner. Additionally, the ng-new schematic has been updated to configure the default testRunner for libraries in angular.json based on the workspace creation options.

Closes #31887

@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Nov 20, 2025
@alan-agius4 alan-agius4 requested a review from clydin November 20, 2025 15:17
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Nov 20, 2025
This commit introduces the `testRunner` option to the library schematic, allowing users to explicitly select between `vitest` and `karma` as their test runner.
Additionally, the `ng-new` schematic has been updated to configure the default `testRunner` for libraries in `angular.json` based on the workspace creation options.

Closes angular#31887
…pping

This commit simplifies the `getTestRunnerDependencies` implementation and renames it to `addTestRunnerDependencies`.
@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 20, 2025
@alan-agius4 alan-agius4 merged commit e288076 into angular:main Nov 20, 2025
35 checks passed
@alan-agius4 alan-agius4 deleted the schematics-vitest branch November 20, 2025 17:52
@alan-agius4
Copy link
Copy Markdown
Collaborator Author

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

@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 Dec 21, 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: @schematics/angular target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng g lib in empty workspace scaffolds old Karma/Jasmine test runner instead of Vitest

2 participants