test(@angular/build): add an E2E test for absolute include paths for unit tests#31713
Merged
alan-agius4 merged 2 commits intoangular:mainfrom Nov 7, 2025
Merged
Conversation
…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.
147ff0d to
066aae0
Compare
…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.
066aae0 to
832305e
Compare
alan-agius4
approved these changes
Nov 7, 2025
Collaborator
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An additional E2E test has been added that tests the usage of an absolute path for the
unit-testcommand line--includeoption.