Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Oct 10, 2025

The unit test discovery logic previously had hardcoded conventions for .spec.ts files. This made it inflexible for projects that use other common patterns, such as .test.ts.

This change introduces support for .test.ts files by default and refactors the discovery logic to be more flexible and maintainable.

Key changes:

  • The unit-test builder schema now includes both **/*.spec.ts and **/*.test.ts in its default include globs.
  • The internal test discovery logic in test-discovery.ts is refactored to use a configurable array of test file infixes (.spec, .test).
  • This allows the smart-handling of static paths (e.g., ng test --include src/app/app.component.ts) to correctly resolve the corresponding test file for both conventions.
  • JSDoc comments and variable names have been updated to improve clarity and reflect the new, more flexible approach.

…t builder

The unit test discovery logic previously had hardcoded conventions for `.spec.ts` files. This made it inflexible for projects that use other common patterns, such as `.test.ts`.

This change introduces support for `.test.ts` files by default and refactors the discovery logic to be more flexible and maintainable.

Key changes:
- The `unit-test` builder schema now includes both `**/*.spec.ts` and `**/*.test.ts` in its default `include` globs.
- The internal test discovery logic in `test-discovery.ts` is refactored to use a configurable array of test file infixes (`.spec`, `.test`).
- This allows the smart-handling of static paths (e.g., `ng test --include src/app/app.component.ts`) to correctly resolve the corresponding test file for both conventions.
- JSDoc comments and variable names have been updated to improve clarity and reflect the new, more flexible approach.
@clydin clydin added the target: major This PR is targeted for the next major release label Oct 10, 2025
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: @angular/build labels Oct 10, 2025
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build detected: feature PR contains a feature commit target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant