npm / jest-preset-angular
jest-preset-angular
What changed in jest-preset-angular 8 to 17, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-24.
38 breaking1 security5 new APIs and options1 performance3 behavior and defaults5 tooling9 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initjest-preset-angular 179 changes
Breaking changes 6
Support for this package in peerDependencies is dropped; use @angular/platform-browser instead.
The minimum supported Angular version is now v20.
The minimum supported version is now 0.28.0.
Configuring ngJest through Jest's globals option is no longer supported; configure it through transform instead.
The minimum supported NodeJs version is now v20.
Support for the fallback is dropped because Angular v20 provides provideZonelessChangeDetection as a stable API.
Security 1
The transformer avoids prototype pollution in the sha1 cache.
Fixes and other changes 2
Polyfills TextEncoder/TextDecoder for the jsdom environment when loading the bundled Angular compiler CLI.
.mjsfiles are downlevel-transformed with esbuild toes2016.
jest-preset-angular 167 changes
Breaking changes 1
Drops support for Angular 18, so projects using that Angular version are no longer supported.
Tooling 2
Adds support for Angular 22, allowing developers to use jest-preset-angular with that Angular release.
Adds support for Angular 21, allowing projects using that Angular version to use jest-preset-angular.
Fixes and other changes 4
Use named exports in setup-env declaration files, fixing their type declarations.
Corrected the condition for detecting Angular 21 when patching module resolution.
Adapts the serializer regex for changes in angular/cdk.
Allows using moduleResolution: bundler with Angular 21.
jest-preset-angular 1516 changes
Breaking changes 12
Angular 18 is the minimum supported version.
The defaults preset was removed; use createCjsPreset instead.
The defaults-esm preset was removed; use createEsmPreset instead.
jest-environment-jsdom is now a mandatory dependency that users must install explicitly.
Jest 30 is required.
jsdom is now a mandatory peer dependency that users must install explicitly.
The minimum supported version of jsdom is 22.
This resolver was removed because it is no longer needed for Jest 30.
Supported Node.js versions are ^18.19.1 || ^20.11.1 || >=22.0.0.
setup-jest files were removed; use setupZoneTestEnv or setupZonelessTestEnv for test environment setup.
Generated snapshots no longer include the root id; update component snapshots with the Jest CLI -u option.
TypeScript 5.5 is the minimum supported version.
New APIs and options 3
Use setupZonelessTestEnv as the replacement for zoneless test environment setup.
Use setupZoneTestEnv as the replacement for zone test environment setup.
Preset creator functions now allow customizing testEnvironment.
Behavior and default changes 1
Running ngcc is no longer required for Angular 16+ projects.
jest-preset-angular 136 changes
Breaking changes 5
Support for Angular 11 and 12 is dropped.
The destroyAfterEach option is no longer available; use testEnvironmentOptions instead.
Jest 29 is required to use this release.
The target from tsconfig is respected according to user configuration instead of being hardcoded to ES2015.
The teardown option is no longer available; use testEnvironmentOptions instead.
Fixes and other changes 1
jest-util was added to the package dependencies.
jest-preset-angular 101 changes
Breaking changes 1
Angular 9 is no longer supported; the minimum supported Angular version is 10.
jest-preset-angular 918 changes
Breaking changes 12
Support is dropped for Angular versions earlier than 8.0.
This AST transformer is removed; remove it from the Jest configuration.
Jest 27 is required.
The HTMLCommentSerializer path is changed to this serializer path.
The AngularSnapshotSerializer path is changed to this serializer path.
The AngularNoNgAttributesSnapshotSerializer path is changed to this serializer path.
Imports from jest-preset-angular should use the setup-jest entry point.
The preset no longer provides moduleNameMapper; users relying on its value need to configure their own mapping.
Support is dropped for Node.js 10; the required Node.js version is now >=12.13.0.
If skipLibCheck is not defined in tsconfig, the preset sets it to true; set it explicitly to false to override.
This AST transformer is removed; remove it from the Jest configuration.
The preset now uses its own transformer, wrapping ts-jest; configure Jest to use jest-preset-angular instead of ts-jest.
New APIs and options 2
An ESM preset is added.
The package.json exports field is added to define package entry points.
Performance 1
The compiler reuses Jest's cacheFS to reduce file system reading.
Tooling 2
The compiler supports ESM.
A type definition is added for the presets entry point.
Fixes and other changes 1
Zone ESM is loaded when Jest runs in ESM mode.
jest-preset-angular 85 changes
Breaking changes 1
Custom Jest configurations must reference serializers, transformers, and setupJest from the build folder; update existing references.
Behavior and default changes 2
The serializer is enabled by default.
The root-folder tsconfig.spec.json is supported by default; move one from src to the root or adjust the Jest configuration.
Tooling 1
core-js is no longer needed as a package.json dependency unless it is imported manually in code.
Fixes and other changes 1
The AST transformer now transforms styles assignments only inside @Component.