Skip to content

inject-migration fails if there is a tsconfig.spec.json but no test files #67684

@Yogu

Description

@Yogu

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

The inject-migration (generate @angular/core:inject) currently throws an error if it any of the tsconfig file it discovers do not reference any source files. As a result, apps that have a test setup but do not have any tests yet cannot run the migration.

The control-flow-migration for instance works differently: It only logs a warning if it did not find any files in all the tsconfig files combined. I think it would make sense to normalize towards this behavior.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Running: npx @angular/cli@21 generate @angular/core:inject --defaults
Could not find any files to migrate under the path /workdir/client/. Cannot run the inject migration.

Please provide the environment you discovered this bug in (run ng version)


Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: migrationsIssues related to `ng update`/`ng generate` migrationsgemini-triagedLabel noting that an issue has been triaged by gemini

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions