Skip to content

test(@angular/build): robustly install @angular/animations in e2e test#33037

Open
clydin wants to merge 1 commit intoangular:mainfrom
clydin:test/fix-chunk-opt-snapshots
Open

test(@angular/build): robustly install @angular/animations in e2e test#33037
clydin wants to merge 1 commit intoangular:mainfrom
clydin:test/fix-chunk-opt-snapshots

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Apr 23, 2026

Enhance the animations package installation in the E2E test to support snapshot E2E runs by resolving the exact dependency specifier from the ng-snapshot manifest when --ng-snapshots is active. Otherwise, it reads the full installed version of @angular/core directly from the local node_modules to avoid semver issues during package installation.

@clydin clydin marked this pull request as ready for review April 23, 2026 15:04
@clydin clydin requested review from alan-agius4 April 23, 2026 15:04
@clydin clydin added action: review The PR is still awaiting reviews from at least one requested reviewer target: minor This PR is targeted for the next minor release labels Apr 23, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the chunk-optimizer-animations E2E test to support Angular snapshot builds by dynamically determining the @angular/animations version based on the environment. A review comment suggests moving the snapshot manifest requirement inside the conditional block to prevent potential runtime errors in environments where the snapshot directory is absent.

Comment thread tests/e2e/tests/build/chunk-optimizer-animations.ts Outdated
if (isSnapshotBuild) {
animationsSpecifier = snapshots.dependencies['@angular/animations'];
} else {
const coreJson = JSON.parse(await readFile('node_modules/@angular/core/package.json'));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not: you can use ‘ readNgVersion’

Enhance the animations package installation in the E2E test to support snapshot E2E runs by resolving the exact dependency specifier from the ng-snapshot manifest when --ng-snapshots is active. Otherwise, it reads the full installed version of @angular/core directly from the local node_modules to avoid semver issues during package installation.
@clydin clydin force-pushed the test/fix-chunk-opt-snapshots branch from 467a824 to 9239b1f Compare April 23, 2026 15:53
@clydin clydin 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 Apr 23, 2026
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: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants