Skip to content

Conversation

jkrems
Copy link
Contributor

@jkrems jkrems commented Dec 4, 2024

The previous logic didn't quite work when interacting with windows path. This PR does three things:

  1. Move the logic to generate unique spec entrypoint names into its own function. This prepares for reusing it elsewhere (e.g. in WTR).
  2. Add a more direct unit test for that logic.
  3. Fix the logic so it works with Windows paths as well as unix paths.

As a drive-by fix, this also cleans up the deduped filenames so we get "foo-2.spec.js" instead of "foo.spec-2.js". The latter looked a bit confusing and it was just a tiiiiny regex to fix those names up. The index append shouldn't really come up in real code very often, so this is very much a tiny niche case.

Fixes #28915

@jkrems jkrems requested a review from clydin December 4, 2024 00:24
@jkrems jkrems added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Dec 4, 2024
@jkrems jkrems force-pushed the jk-win-spec-collision branch from 92d1bc8 to 0a1cc09 Compare December 4, 2024 00:26
@jkrems jkrems marked this pull request as ready for review December 4, 2024 01:16
@jkrems jkrems force-pushed the jk-win-spec-collision branch from 0a1cc09 to 634409d Compare December 5, 2024 02:03
@jkrems jkrems 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 Dec 5, 2024
@jkrems jkrems force-pushed the jk-win-spec-collision branch from 634409d to 101434a Compare December 5, 2024 02:07
@alan-agius4 alan-agius4 force-pushed the jk-win-spec-collision branch from 101434a to be3f7ca Compare December 5, 2024 15:14
@alan-agius4 alan-agius4 merged commit 9e2d3fb into angular:main Dec 5, 2024
30 checks passed
@alan-agius4
Copy link
Collaborator

The changes were merged into the following branches: main, 19.0.x

@jkrems jkrems deleted the jk-win-spec-collision branch December 5, 2024 15:52
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Karma in application build mode throws "handle multiple spec files with same name"

3 participants