You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(@schematics/angular): add Vitest config generation and runner checks
This commit expands the `config` schematic to support generating a `vitest-base.config.ts` file and includes runner checks to prevent misconfiguration.
Changes include:
- Added 'vitest' as a valid type for the `config` schematic in `schema.json`.
- Created a new `vitest-base.config.ts.template` file for generating a basic Vitest configuration.
- Implemented the `addVitestConfig` function in `packages/schematics/angular/config/index.ts`:
- Verifies that the project's `test` target uses the `@angular/build:unit-test` builder.
- Copies the `vitest-base.config.ts` template to the project root.
- Sets the `runnerConfig` option to `true` in `angular.json` to enable automatic discovery.
- Includes warning logic to notify users if the `runner` option in `angular.json` is explicitly set to `karma`, indicating that the generated Vitest config may not be used.
(cherry picked from commit 8edd3ef)
0 commit comments