Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Nov 6, 2025

An additional E2E test has been added that tests the usage of an absolute path for the unit-test command line --include option.

…unit tests

An additional E2E test has been added that tests the usage of an absolute
path for the `unit-test` command line `--include` option.
@clydin clydin force-pushed the unit-test/absolute-include-e2e branch from 147ff0d to 066aae0 Compare November 6, 2025 21:05
…st discovery

The `findTests` function's path normalization logic had two flaws that affected cross-platform compatibility and user experience:

1.  Absolute paths provided in the `include` patterns were incorrectly processed. The leading slash was removed, causing the globber to fail to find the specified test files.

2.  The prefix removal logic was case-sensitive, which would fail to normalize workspace-relative paths on case-insensitive filesystems (like Windows and macOS) if the user's input casing for the project path differed from the actual directory casing.

This commit corrects both issues:

- The `normalizePattern` function now uses `isAbsolute` to detect and preserve absolute paths, ensuring they are passed to the globber unmodified.
- The `removePrefix` helper function is now conditionally case-insensitive based on the host operating system (`win32`, `darwin`), aligning its behavior with the underlying filesystem and making path normalization more robust.
- Minor code style refactoring and JSDoc comments have been added for clarity.
@clydin clydin force-pushed the unit-test/absolute-include-e2e branch from 066aae0 to 832305e Compare November 6, 2025 21:20
@clydin clydin marked this pull request as ready for review November 6, 2025 22:16
@clydin clydin added target: rc This PR is targeted for the next release-candidate action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 6, 2025
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 7, 2025
@alan-agius4 alan-agius4 merged commit 683d0e0 into angular:main Nov 7, 2025
34 of 35 checks passed
@alan-agius4
Copy link
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the unit-test/absolute-include-e2e branch November 7, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants