Skip to content

build: fix CI after @angular/build 22.2.0 and jest-preset-angular 17.0.1 - #604

Merged
timdeschryver merged 2 commits into
mainfrom
build/fix-ci-dependency-drift
Sep 30, 2026
Merged

timdeschryver merged 2 commits into
mainfrom
build/fix-ci-dependency-drift

Conversation

@timdeschryver

Copy link
Copy Markdown
Member

CI currently fails on any fresh run, including main, because there is no lockfile and two dependencies released minor/patch versions after main's last green run (Sep 16). This is why #603 fails on code it doesn't touch.

1. @angular/build 22.2.0 → NG4001 in test:testing-library

NG4001: Angular compiler option "flatModuleOutFile" requires one and only one .ts file in the "files" field.

projects/testing-library/tsconfig.spec.json inherits flatModuleId/flatModuleOutFile from projects/testing-library/tsconfig.json while including **/*.ts. 22.2.0 now validates this in the test build (22.1.8 and 22.1.9 pass). ng-packagr sets these options itself when building the library, so they're removed. npm run build still emits the same fesm2022 bundles and .d.ts files for all entry points.

2. jest-preset-angular 17.0.1 → 09-router.spec.ts fails in test:jest-app

17.0.1 (fb544ac) changed the esbuild target for .mjs dependencies from es2016 to es2022. As a result, async/await in the Angular packages is no longer downleveled, and zone.js can't track native async/await. The zone-based router example then asserts before the navigation's change detection has run. jest-preset-angular still uses es2015 when the tsconfig target is ES2015, so the jest example app's tsconfig.spec.json now targets ES2015 (the @angular-builders/jest default transform uses this tsconfig for .ts and .mjs files).

Testing

Ran the full CI step sequence locally on a fresh install that resolved @angular/build@22.2.0 and jest-preset-angular@17.0.1:

  • npm run build
  • npm run test:testing-library
  • npm run test:example-app
  • npm run test:jest-app: 53 passed, 3 skipped
  • npm run test:karma-app -- --watch=false --no-progress: 5/5
  • npm run lint

Once this is merged, #603 needs its branch updated to pick up the fix.

🤖 Generated with Claude Code

timdeschryver and others added 2 commits September 30, 2026 20:59
@angular/build 22.2.0 validates flatModuleOutFile in test builds, which
fails with NG4001 because tsconfig.spec.json inherits the option while
including all .ts files. ng-packagr sets these options itself when
building the library, so they are not needed here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jest-preset-angular 17.0.1 changed the esbuild target for .mjs
dependencies from es2016 to es2022, so async/await in Angular packages
is no longer downleveled. zone.js cannot track native async/await,
which breaks the zone-based router example test. Targeting ES2015
makes jest-preset-angular downlevel them again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@timdeschryver
timdeschryver merged commit 8fea71c into main Sep 30, 2026
6 checks passed
@timdeschryver
timdeschryver deleted the build/fix-ci-dependency-drift branch September 30, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant