Skip to content

ng g lib in empty workspace scaffolds old Karma/Jasmine test runner instead of Vitest #31887

@dzonatan

Description

@dzonatan

Command

test

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Somehow I was lucky to hit this issue on the first try.
When generating a library in a completely empty workspace - it still points to Karma/Jasmine instead of Vitest.
If workspace isn't empty at the time of generation - it scaffolds vitest correctly.

Minimal Reproduction

  1. ng new my-workspace --create-application false
  2. cd my-workspace
  3. ng g lib my-lib

Exception or Error

Both `tsconfig.spec.json` and `angular.json` points to Karma/Jasmine.

Your Environment

Angular CLI       : 21.0.0
Angular           : 21.0.0
Node.js           : 22.20.0
Package Manager   : npm 10.9.3
Operating System  : darwin arm64

Anything else relevant?

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions