feat(@schematics/angular): configure Vitest for new projects and libraries#31578
Merged
alan-agius4 merged 1 commit intoangular:mainfrom Oct 23, 2025
Merged
Conversation
31a6f6f to
d698d39
Compare
…w runner choice This commit updates the application, ng-new, and library schematics to configure Vitest as the default unit testing runner, replacing Karma and Jasmine. It also introduces a `testRunner` option to allow users to choose between `vitest` and `karma`. Key changes: Application & Ng-New Schematics: - Adds a `testRunner` option to allow choosing between `vitest` (default) and `karma`. - Sets "@angular/build:unit-test" as the builder for the "test" target when `vitest` is chosen, and "@angular/build:karma" for `karma`. - Conditionally adds dependencies based on the selected runner. - Updates "tsconfig.spec.json" to include "vitest/globals" or "jasmine" for type support. Library Schematic: - Conditionally configures the "test" target with the "@angular/build:unit-test" builder if Vitest is detected in the workspace. - Dynamically sets the "types" in "tsconfig.spec.json" to "vitest/globals" or "jasmine" based on the presence of Vitest.
d698d39 to
8f82898
Compare
alan-agius4
approved these changes
Oct 23, 2025
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This commit updates the application, ng-new, and library schematics to configure Vitest as the default unit testing runner, replacing Karma and Jasmine. It also introduces a
testRunneroption to allow users to choose betweenvitestandkarma.Application &
ng newSchematics:testRunneroption to allow choosing betweenvitest(default) andkarma.vitestis chosen, and "@angular/build:karma" forkarma.Library Schematic: