Skip to content

Conversation

@just-jeb
Copy link
Owner

@just-jeb just-jeb commented Dec 14, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Packages support Angular 20 with Jest 29 and zone.js-based testing.

Issue Number: #1957, #1931, #1934, #108

What is the new behavior?

  • Upgrade all packages to Angular CLI 21 / Angular 21
  • Upgrade @angular-builders/jest to use Jest 30 via jest-preset-angular v16
  • Add zoneless testing support with new zoneless option (default: true)
  • Rename configPath to config with inline object/JSON support
  • Update example applications for Angular 21 patterns

Does this PR introduce a breaking change?

[x] Yes
[ ] No

Breaking Changes

All Packages

  • Requires Angular CLI 21 / Angular 21

@angular-builders/jest

Jest 30 Required

npm install --save-dev jest@^30.0.0 jest-environment-jsdom@^30.0.0 jsdom@^26.0.0

tsconfig.spec.json Update Required
{
  "compilerOptions": {
    "module": "Node16",
    "moduleResolution": "Node16",
    "isolatedModules": true
  }
}

Zoneless Testing (New Default)
- zoneless option added, defaults to true
- Apps using zone.js change detection must set zoneless: false

Renamed/Removed Options
- configPath → config (now also supports inline objects)
- testPathPattern → testPathPatterns
- Removed: browser, init, mapCoverage, testURL, timers
- globalMocks now only supports matchMedia

@angular-builders/custom-esbuild

- buildTarget and tsConfig no longer required in unit-test builder schema

Other information

Closes #1957, #1931, #1934, #108

@just-jeb just-jeb force-pushed the upgrade-angular-21 branch 2 times, most recently from 5337abb to 0bc5416 Compare December 14, 2025 13:54
@just-jeb just-jeb mentioned this pull request Dec 14, 2025
BREAKING CHANGE: All packages now require Angular 21

Closes #1957
BREAKING CHANGE: Requires Jest 30

Users must upgrade:
npm install --save-dev jest@^30.0.0 jest-environment-jsdom@^30.0.0 jsdom@^26.0.0

Also requires tsconfig.spec.json update for moduleResolution compatibility:
{
  "compilerOptions": {
    "module": "Node16",
    "moduleResolution": "Node16",
    "isolatedModules": true
  }
}

Schema changes:
- testPathPattern renamed to testPathPatterns
- Removed: browser, init, mapCoverage, testURL, timers

Closes #1931
BREAKING CHANGE: zoneless is now the default

Apps using zone.js change detection must set zoneless: false in angular.json.

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

Closes #1934
BREAKING CHANGE: configPath option renamed to config

The config option now accepts:
- File path (string): "jest.config.js"
- JSON string: '{"verbose": true}'
- Inline object in angular.json

Closes #108
@just-jeb just-jeb changed the title Upgrade angular 21 Support Angular 21 Dec 17, 2025
@just-jeb just-jeb merged commit 7bfe312 into master Dec 17, 2025
1 check passed
@just-jeb just-jeb deleted the upgrade-angular-21 branch December 17, 2025 17:20
@berkon
Copy link

berkon commented Dec 23, 2025

@just-jeb can you tell when there will be a new version of the @angular-builders/jest package on NPM? Currently its still version 20 supporting Angular 20 and Jest 29. Thanks!

@th0r
Copy link
Contributor

th0r commented Dec 23, 2025

@berkon it's released under v21.0.0-beta.1

@just-jeb
Copy link
Owner Author

@berkon Currently it's available under the @next tag, I'm giving it some grace period and will graduate after the holidays.

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.

Angular 21 support

6 participants