Skip to content

Vitest unit test fails when run with --include command option with relative path #31829

@wein2011

Description

@wein2011

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

With 21.0.0-rc.4, unit-test supports commands with absolute paths on Windows 11 such as:

ng test --browsers ChromiumHeadless --ui --watch --include="C:\myapp\src\app\app.spec.ts" 

However, relative paths such as:

ng test --browsers ChromiumHeadless --ui --watch --include="src\app\app.spec.ts" 

build but then error with:

No test files found. You can change the file name pattern by pressing "p" 

Minimal Reproduction

See commands above

Exception or Error

 

Your Environment

Angular CLI : 21.0.0-rc.4 Angular : 21.0.0-rc.2 Node.js : 22.18.0 Package Manager : npm 10.9.3 Operating System : win32 x64 ┌───────────────────────────┬───────────────────┬───────────────────┐ │ Package │ Installed Version │ Requested Version │ ├───────────────────────────┼───────────────────┼───────────────────┤ │ @angular/build │ 21.0.0-rc.4 │ ^21.0.0-rc.4 │ │ @angular/cli │ 21.0.0-rc.4 │ ^21.0.0-rc.4 │ │ @angular/common │ 21.0.0-rc.2 │ ^21.0.0-rc.2 │ │ @angular/compiler │ 21.0.0-rc.2 │ ^21.0.0-rc.2 │ │ @angular/compiler-cli │ 21.0.0-rc.2 │ ^21.0.0-rc.2 │ │ @angular/core │ 21.0.0-rc.2 │ ^21.0.0-rc.2 │ │ @angular/forms │ 21.0.0-rc.2 │ ^21.0.0-rc.2 │ │ @angular/platform-browser │ 21.0.0-rc.2 │ ^21.0.0-rc.2 │ │ @angular/router │ 21.0.0-rc.2 │ ^21.0.0-rc.2 │ │ rxjs │ 7.8.2 │ ~7.8.0 │ │ typescript │ 5.9.3 │ ~5.9.2 │ │ vitest │ 4.0.9 │ ^4.0.9 │ └───────────────────────────┴───────────────────┴───────────────────┘ 

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions