Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(@schematics/angular): configure Vitest for new projects and libraries#31578

Merged
alan-agius4 merged 1 commit into
angular:mainangular/angular-cli:mainfrom
clydin:vitest/default-new-projectsclydin/angular-cli:vitest/default-new-projectsCopy head branch name to clipboard
Oct 23, 2025
Merged

feat(@schematics/angular): configure Vitest for new projects and libraries#31578
alan-agius4 merged 1 commit into
angular:mainangular/angular-cli:mainfrom
clydin:vitest/default-new-projectsclydin/angular-cli:vitest/default-new-projectsCopy head branch name to clipboard

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Oct 23, 2025

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.

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.

@clydin clydin force-pushed the vitest/default-new-projects branch 6 times, most recently from 31a6f6f to d698d39 Compare October 23, 2025 12:45
@clydin clydin marked this pull request as ready for review October 23, 2025 12:59
…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.
@clydin clydin force-pushed the vitest/default-new-projects branch from d698d39 to 8f82898 Compare October 23, 2025 13:04
@clydin clydin requested a review from alan-agius4 October 23, 2025 13:05
@alan-agius4 alan-agius4 added target: major This PR is targeted for the next major release action: merge The PR is ready for merge by the caretaker labels Oct 23, 2025
@alan-agius4 alan-agius4 merged commit 2ffc527 into angular:main Oct 23, 2025
33 checks passed
@clydin clydin deleted the vitest/default-new-projects branch October 23, 2025 13:20
@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 Nov 23, 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 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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.