Use Vitest for library schematics tests#24788
Merged
sumeyyeKurtulus merged 1 commit intodevfrom Feb 3, 2026
Merged
Conversation
Migrate library schematic test setup from Karma/Jasmine to Vitest and Angular standalone testing. Removed Karma config and legacy test.ts templates, added src/test-setup.ts templates that initialize Angular testing with zone.js/testing and BrowserTestingModule. Updated tsconfig.lib.json to exclude src/test-setup.ts and tsconfig.spec.json to use "vitest/globals" types and simplified include/files. Adjusted generate-lib to use a UnitTest builder with a vitest runner and buildTarget instead of Karma-specific options, and added UnitTest to Builders enum.
sumeyyeKurtulus
approved these changes
Feb 3, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Migrate library schematic test setup from Karma/Jasmine to Vitest and Angular standalone testing. Removed Karma config and legacy test.ts templates, added src/test-setup.ts templates that initialize Angular testing with zone.js/testing and BrowserTestingModule. Updated tsconfig.lib.json to exclude src/test-setup.ts and tsconfig.spec.json to use "vitest/globals" types and simplified include/files. Adjusted generate-lib to use a UnitTest builder with a vitest runner and buildTarget instead of Karma-specific options, and added UnitTest to Builders enum.
Resolves #24714 (write the related issue number if available)
How to test it?
How to test it?
Build the schematics package:
abp/npm/ng-packsLink the built schematics package locally:
abp/npm/ng-packs/dist/packages/schematicsLink
@abp/ng.schematicsinto the template project:volo/abp/templates/module/angularRun the generator:
volo/abp/templates/module/angular, run:When prompted, use the following options:
test-full-libNo(false)standaloneRun the tests:
volo/abp/templates/module/angular, run:yarn test