Skip to content

New project tests fail #32087

@klofi

Description

@klofi

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

Running ng test in brand new project made via angular-cli v21.0.2 fails on error Error: Cannot find module '/src/app/app.spec.ts'.

Image

Minimal Reproduction

Repro in Terminal (Windows 11):

ng new angular21dot0dot2 --ssr=false --style=scss --ai-config=none
cd angular21dot0dot2
ng test

Exception or Error

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL   angular21dot0dot2  src/app/app.spec.ts [ src/app/app.spec.ts ]
Error: Cannot find module '/src/app/app.spec.ts'

Your Environment

Angular CLI       : 21.0.2
Node.js           : 22.21.1
Package Manager   : npm 10.9.4
Operating System  : win32 x64

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions