[angular/angular-cli] feat(@schematics/angular): configure Vitest for new projects and libraries (PR #31578)
DRANK

This commit updates the application and library schematics to configure Vitest as the unit testing framework, replacing Karma and Jasmine. Key changes: Application Schematic: - Sets '@angular/build:unit-test' as the default builder for the 'test' target. - Adds 'vitest' and 'jsdom' as default dev dependencies. - Removes Karma, Jasmine, and related packages from the generated 'package.json'. - Updates 'tsconfig.spec.json' to include 'vitest/globals' 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.

github.com
Related Topics: Angular
2 comments