Skip to content

Conversation

@just-jeb
Copy link
Owner

Summary

  • Add zoneless option (default: true) to configure test environment for Angular 21+
  • Create separate setup files for zone and zoneless modes
  • Remove obsolete global mocks (styleTransform, getComputedStyle, doctype)
  • Keep only matchMedia mock (jsdom still doesn't support it)
  • Update example apps to test both paths
  • Filter builder-specific options before passing to Jest CLI

Breaking Changes

  1. Zoneless is now default: Apps using zone.js change detection must set zoneless: false in angular.json
  2. Global mocks reduced: Only matchMedia is supported. The styleTransform, getComputedStyle, and doctype mocks have been removed as Jest 30's jsdom supports these natively

Test plan

  • Unit tests pass (26 tests)
  • simple-app tests pass (zone-based with zoneless: false)
  • my-second-app tests pass (zone-based with zoneless: false)
  • my-first-app tests pass (zoneless default)
  • my-shared-library tests pass (zoneless default)

🤖 Generated with Claude Code

just-jeb and others added 3 commits December 15, 2025 11:38
- Add `zoneless` option (default: true) to configure test environment
- Create separate setup files for zone and zoneless modes
- Remove obsolete global mocks (styleTransform, getComputedStyle, doctype)
- Keep only matchMedia mock (jsdom still doesn't support it)
- Update example apps: simple-app/my-second-app use zone.js,
  my-first-app/my-shared-library use zoneless
- Filter builder-specific options before passing to Jest CLI

BREAKING CHANGE: zoneless is now the default. Apps using zone.js
change detection must set `zoneless: false` in angular.json.

BREAKING CHANGE: globalMocks option only supports matchMedia.
The styleTransform, getComputedStyle, and doctype mocks have been
removed as Jest 30's jsdom supports these natively.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove zone.js from polyfills
- Add provideZonelessChangeDetection() provider
- Convert AppComponent to use signals
- Add test verifying zoneless change detection works automatically

This demonstrates a complete zoneless Angular 21 setup where signal
updates automatically trigger view updates without zone.js.
The new zoneless test added a 4th test to my-first-app.
@just-jeb just-jeb merged commit a2f31c4 into upgrade-angular-21 Dec 15, 2025
1 check passed
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.

2 participants