78 KiB
16.0.0 (2025-12-04)
Features
- add support for Angular 21 (8d4d11f)
BREAKING CHANGES
- Drop support for Angular 18
15.0.3 (2025-10-17)
Bug Fixes
- handle
processWithEsbuildtransform option (6779107)
15.0.2 (2025-10-01)
Bug Fixes
15.0.1 (2025-09-15)
Bug Fixes
15.0.0 (2025-07-22)
Bug Fixes
- fix(serializers): generated
id="root{n}"should be removed (a6b908f)
Features
- feat: allow to customize
testEnvironmentvia preset creator functions (80c95e8) - feat: upgrade jest to 30 (51df6ec)
Code Refactoring
- refactor: mark
jest-environment-jsdomas peer dependency (f9e2b70) - refactor: drop support for
jsdom<22 (da9cb15) - refactor: drop support for
typescript<5.4 (873ab73) - refactor: drop support for Angular <17 (3a60492)
- refactor: drop support for Node.js <18 (aeef774)
- refactor: remove
defaultsanddefaults-esmpresets (94dd3b1) - refactor: remove
setup-jestfiles (6bf89a4) - refactor: remove global setup script with
ngcc(35819c9)
BREAKING CHANGES
- Jest 30 is required
- Minimum supported version for
JSDOMis 26 ng-jest-resolveris no longer needed for Jest 30 therefore it was removedjsdomdep is now MANDATORY peer dependency. Users are required to installjsdomexplicitlyjest-environment-jsdomis now MANDATORY dependency. Users are required to installjest-environment-jsdomexplicitly- Various legacy documentation pages were removed.
- Snapshot generation is affected by (a6b908f). One should update component snapshots via
-uJest CLI option. Since this change only removes the rootid, it shouldn't affect the quality of snapshots in general. - The supported
NodeJsversions are^18.19.1 || ^20.11.1 || >=22.0.0. - The minimum supported version for Angular is 18 following Angular support policy https://angular.dev/reference/releases#actively-supported-versions
- The minimum supported version for
jsdomis 22 - The minimum supported version of
TypeScriptis 5.5 following the support version from Angular 18 - Running
ngccis not required for Angular 16+ project - Use
createCjsPresetas a replacement fordefaultspreset - Use
createEsmPresetas a replacement fordefaults-esmpreset - Use
setupZoneTestEnvas a replacement for zone test environment setup - Use
setupZonelessTestEnvas a replacement for zoneless test environment setup
14.6.2 (2025-10-17)
Bug Fixes
- handle
processWithEsbuildtransform option (6779107)
14.6.1 (2025-07-21)
Bug Fixes
14.6.0 (2025-06-02)
Features
- feat: add support for angular 20 (e041857)
14.5.5 (2025-04-15)
Bug Fixes
- fix: allow name exports for
presetssubpath (9100baf)
15.0.0-next.0 (2025-02-28)
Bug Fixes
- fix(serializers): generated
id="root{n}"should be removed (a6b908f)
Code Refactoring
- refactor: drop support for
jsdom<22 (da9cb15) - refactor: drop support for
typescript<5.4 (873ab73) - refactor: drop support for Angular <17 (3a60492)
- refactor: drop support for Node.js <18 (aeef774)
- refactor: remove
defaultsanddefaults-esmpresets (94dd3b1) - refactor: remove
setup-jestfiles (6bf89a4) - refactor: remove global setup script with
ngcc(35819c9)
BREAKING CHANGES
- Snapshot generation is affected by (a6b908f). One should update component snapshots via
-uJest CLI option. Since this change only removes the rootid, it shouldn't affect the quality of snapshots in general. - The supported
NodeJsversions are^18.19.1 || ^20.11.1 || >=22.0.0. - The minimum supported version for Angular is 18 following Angular support policy https://angular.dev/reference/releases#actively-supported-versions
- The minimum supported version for
jsdomis 22 - The minimum supported version of
TypeScriptis 5.5 following the support version from Angular 18 - Running
ngccis not required for Angular 16+ project - Use
createCjsPresetas a replacement fordefaultspreset - Use
createEsmPresetas a replacement fordefaults-esmpreset - Use
setupZoneTestEnvas a replacement for zone test environment setup - Use
setupZonelessTestEnvas a replacement for zoneless test environment setup
14.5.4 (2025-03-31)
Bug Fixes
- fix: warn when using both
isolatedModulesandemitDecoratorMetadata#3029 (51db8f4) - update dependency ts-jest to v29.3.0 (1d8415d)
14.5.3 (2025-02-24)
Bug Fixes
- build: update bundle
jit_transform.js, closes #2979
14.5.2 (2025-02-21)
Bug Fixes
14.5.1 (2025-01-25)
Bug Fixes
14.5.0 (2025-01-10)
Features
Code Refactoring
- refactor: add type for
serializers/index.ts(dd64d78)
DEPRECATIONS
- refactor: deprecate
defaultTransformerOptionsinpresets(99d3112) - refactor: deprecate
ngccutil viaglobalSetup(edeaa3f)
14.4.2 (2024-12-03)
Bug Fixes
14.4.1 (2024-11-28)
Bug Fixes
- fix: remove
@angular-devkit/build-angularfrompeerDependencies(2f6bc3d)
14.4.0 (2024-11-27)
Features
Code Refactoring
- refactor: use
createCjsPresetfunction forjest-preset.js(9d18d0f) - refactor: deprecate legacy presets (8da5630)
DEPRECATIONS
- Using
preset: 'jest-preset-angular'is deprecated. The recommended approach is https://thymikee.github.io/jest-preset-angular/docs/getting-started/presets#createcjspresetoptions - Using
preset: 'jest-preset-angular/presets/defaults-esm'is deprecated. The recommended approach is https://thymikee.github.io/jest-preset-angular/docs/getting-started/presets#createesmpresetoptions
14.3.3 (2024-11-22)
Features
- feat: support configuring zoneless test env for CJS (7a270b1)
14.3.2 (2024-11-20)
Bug Fixes
14.3.1 (2024-11-18)
Documentation
- docs: simplify
README.mdabout installation and configuration (79ea18b)
14.3.0 (2024-11-15)
Features
- feat: add new setup test env functions
setupZoneTestEnvandsetupZonelessTestEnv(21c0238), closes #354 #2755 - feat: build package with type definitions (a269daa)
- feat: deprecate
setup-jest.jsandsetup-jest.mjs(a304036)
Code Refactoring
- test: switch example app test config files to ts (e61f1ff)
DEPRECATIONS
Importing setup-jest.js/setup-jest.mjs directly is deprecated. The files will be removed in the future.
Please use setupZoneTestEnv function instead. Example:
For CJS
// setup-jest.ts
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
setupZoneTestEnv();
For ESM
// setup-jest.ts
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone/index.mjs';
setupZoneTestEnv();
See more at https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
14.2.4 (2024-09-12)
Bug Fixes
- build: ensure build step runs before publishing (3a602db)
14.2.3 (2024-09-12)
Bug Fixes
14.2.2 (2024-07-31)
Bug Fixes
- fix: publish correct build assets, closes #2641
14.2.1 (2024-07-30)
Bug Fixes
- fix: load ts lib files to properly transform constructor for
isolatedModules: true(31e78b1)
14.2.0 (2024-07-22)
Features
Code Refactoring
- refactor(compiler): replace copied codes from ts source with public API (ad7a297)
- refactor(serializers): improve codes for snapshot serializer (047f09a)
- refactor(serializers): use proper ts types for
ng-snapshot(3ce21cd)
14.1.1 (2024-06-19)
Features
14.1.0 (2024-05-21)
Features
- extend version support range to Angular 18 (24e097d)
- remove ivy flag for snapshot serializer (3433cd8)
14.0.4 (2024-05-07)
Features
- Support generic type for signal queries, closes #2392
- Support
outputFromObservable, closes #2374 - Support
input.required, closes #2370
14.0.3 (2024-02-16)
Features
- support signal queries in Angular 17.2 (a57ad7d)
14.0.2 (2024-02-11)
Performance Improvements
- reduce package size and speed up execution (d7cbbac)
14.0.1 (2024-02-09)
Features
- remove esbuild-check workaround (2e0fa38)
- set version for
esbuildto be version from Angular 15.x.x (af38578) - support signal inputs, queries and model (#2303) (7f7a22f), closes #2246 #2255
14.0.0 (2024-01-11)
BREAKING CHANGES
- Drop support for Angular 13, 14 (a3091b5)
13.1.6 (2024-01-11)
Bug Fixes
13.1.5 (2024-01-03)
Bug Fixes
13.1.4 (2023-11-11)
Bug Fixes
13.1.3 (2023-11-06)
Features
13.1.2 (2023-09-19)
Code Refactoring
13.1.1 (2023-05-14)
Bug Fixes
13.1.0 (2023-05-06)
Features
- bump peer deps to support angular 16 (#2061) (18abd21)
- utils: skip ngcc processing in ng16 or higher (#2063) (2661988)
13.0.1 (2023-03-21)
Bug Fixes
13.0.0 (2023-02-18)
Bug Fixes
- add
jest-utilto list ofdependencies(#1777) (db8f7c9), closes #1773 - typo in
esbuild-check.js(#1806) (c2f2b61)
Features
- support Jest 29 (#1937) (b0b57a7), closes #1774
- config: remove hardcoded logic setting
targettoES2015(#1788) (695c730) - remove
destroyAfterEachandteardownoptions (#1768) (fe4c73b)
BREAKING CHANGES
- Drop support for Angular 11, 12
- Jest 29 is required
destroyAfterEachandteardownare no longer available to use, please usetestEnvironmentOptionsinstead.targetistsconfigis now respected according to user configuration, it is no longer hardcoded atES2015. See also note at https://thymikee.github.io/jest-preset-angular/docs/getting-started/installation
13.0.0-next.1 (2023-01-27)
Features
13.0.0-next.0 (2023-01-26)
Bug Fixes
- add
jest-utilto list ofdependencies(#1777) (db8f7c9), closes #1773 - typo in
esbuild-check.js(#1806) (c2f2b61)
Features
- config: remove hardcoded logic setting
targettoES2015(#1788) (695c730) - drop support for Angular 11 (#1767) (22f2cd6)
- drop support for Angular 12 (#1843) (dc58df1)
- remove
destroyAfterEachandteardownoptions (#1768) (fe4c73b)
12.2.6 (2023-01-26)
Bug Fixes
12.2.5 (2023-01-18)
Bug Fixes
- Fix support for Angular 12 caused by the fix with downlevel-ctor transformer from https://github.com/angular/angular/pull/48638
12.2.4 (2023-01-16)
Bug Fixes
- support TypeScript 4.2 for Angular 12 (8b59e79)
- Including Angular fix for downlevel-ctor transformer, see https://github.com/angular/angular/pull/48638
12.2.3 (2022-11-26)
Features
- support Angular 15 (b2cc6df)
12.2.2 (2022-08-29)
Bug Fixes
12.2.1 (2022-08-28)
Bug Fixes
12.2.0 (2022-07-14)
Bug Fixes
Features
- add
global-setup.mjsto use with Jest ESM mode (#1661) (97a0ec8) - allow configuring options
TestEnvironmentOptionsfor setup test env (#1657) (a64a4ac), closes #1656
12.1.0 (2022-06-03)
Features
- allow passing the
teardownobject toglobal-setup(#1475) (3dab02b) - support Angular 14 (#1611) (7c294d7), closes #1410
12.0.1 (2022-05-14)
Features
- allow configuring
destroyAfterEachviaglobalThisfor setup test env (#1469) (9a735f9), closes #1466
12.0.0 (2022-05-10)
Bug Fixes
- add missing
jestandtypescriptto peer deps (#1442) (6a652af), closes #1441 - set range supported version for Angular peer deps (#1449) (f3e97d7)
Features
- config: add
setup-jest.mjsfor ESM mode (#1463) (cc6ce3f) - add an option to configure which file processed by
esbuild(#1455) (b58d089), closes #1413 #1437 - drop support Node 12 (04195d5)
- exclude
ng-jest-resolverfrom default/esm presets (#1440) (56673c4) - remove
reflect-metadatainsetup-jest(#1428) (5a36729) - remove
zone-patchand its fallback (#1427) (bf9ea44) - allow running
ngccwith specifictsconfigpath (#1418) (5f535b5), closes #1348 - allow skip
ngccviaskipNgccoption viaglobalThis(#1417) (7950b5c), closes #1396 - remove
ngcc-jest-processorentry file (#1414) (2c5fd20)
BREAKING CHANGES
- Since Angular 11, the minimum version of
zone.jsis 0.11.x and Angular 10 is EOL, so now we can use zone patch directly fromzone.js. If one is not usingzone.js@0.11.x, please upgrade. - Now we are using Angular AST transformers,
reflect-metadatais not needed anymore. - Jest 28 correctly resolves Angular package format files so the
ng-jest-resolveris now optional. - Node 12 is no longer support
- Previously, we always checked file extension
.mjsand any files fromnode_modulesexcludingtslibto be processed withesbuild. With the new optionprocessWithEsbuild, now we put default all.mjsfiles to be processed byesbuild. Files likelodash-esdefault isn't processed byesbuild. If you wish to useesbuildto process such files, please configure in your Jest config like
// jest.config.js
module.exports = {
//...
globals: {
ngJest: {
processWithEsbuild: ['**/node_modules/lodash-es/*.js],
}
}
}
- Angular 10 is no longer support
- Require Jest 28
ngcc-jest-processorentry file is now removed. One should usejest-preset-angular/global-setupinstead.
11.1.2 (2022-04-24)
Bug Fixes
11.1.1 (2022-02-11)
Performance Improvements
- transformer: cache checking
esbuildresult (#1309) (3412142) - transformer: leverage the
ts-jestconfig set cache (#1318) (d47d1eb), closes #1311
11.1.0 (2022-01-20)
Bug Fixes
DEPRECATIONS
11.0.1 (2021-11-22)
Bug Fixes
11.0.0 (2021-11-18)
Bug Fixes
- presets: use
ts-jesttypes for preset types (#1172) (81854f6) - presets: add
mjsto the list ofmoduleFileExtensions(#1155) (3c992a1), closes #1147
Features
Code Refactoring
Performance Improvements
- process
jsfiles innode_moduleswithesbuild(#1169) (1de3bf0) - use
esbuildto process.mjsfiles (#1142) (5d3fe10), closes #1141
BREAKING CHANGES
jsfiles fromnode_modulesare now compiled withesbuildto improve performance.- NodeJs range version support now is
^12.20.0 || ^14.15.0 || >=16.10.0 - Due to the introduction of ESM package format for Angular packages, several things are added to the default preset
to handle
.mjsfiles from Angular ESM packages. Please check our migration documentation at https://thymikee.github.io/jest-preset-angular/docs/next/guides/angular-13+
Special Thanks
Alan Agius, Pete Bacon Darwin from Angular team
11.0.0-rc.4 (2021-11-15)
Performance Improvements
Code Refactoring
BREAKING CHANGES
jsfiles fromnode_modulesare now compiled withesbuildto improve performance.
11.0.0-rc.3 (2021-11-09)
Bug Fixes
- presets: add
mjsto the list ofmoduleFileExtensions(#1155) (3c992a1), closes #1147 - bring back checks on
undefined/nullforno-ng-attributes(#1154) (1e7dbf8) - serializers: revert partially changes in
ng-snapshot(#1150) (44b3b77), closes #1148
11.0.0-rc.2 (2021-11-08)
Performance Improvements
11.0.0-rc.1 (2021-11-04)
Bug Fixes
11.0.0-rc.0 (2021-11-04)
Features
BREAKING CHANGES
- NodeJs range version support now is
^12.20.0 || ^14.15.0 || >=16.10.0 - Due to the introduction of ESM package format for Angular packages, several things are added to the default preset
to handle
.mjsfiles from Angular ESM packages. Please check our migration documentation at https://thymikee.github.io/jest-preset-angular/docs/next/guides/angular-13+
Special Thanks
Alan Agius, Pete Bacon Darwin from Angular team
10.1.0 (2021-10-26)
Bug Fixes
Code Refactoring
- transformers use Angular
downlevel-ctortransformer (#1099) (3c26aba) - transformers remove workaround for ts < 4.0 in
replace-resourcetransformer (#1100) (ce68298) - transformers migrate
html-commentto new Jest serializer (#1114) (3005330)
10.0.1 (2021-09-27)
Bug Fixes
10.0.0 (2021-09-16)
Build
BREAKING CHANGES
Angular 9 is no longer supported, see https://angular.io/guide/releases#support-policy-and-schedule The minimum support Angular version now is 10
9.0.7 (2021-08-20)
Bug Fixes
9.0.6 (2021-08-17)
Bug Fixes
- config: set
allowJs: trueinternally always (#976) (9900c8b), closes #974 - utils: throw error when cannot find
@angular/coreforngcc-jest-preprocessorutil (#981) (c35d3f2)
9.0.5 (2021-07-22)
Features
Code Refactoring
- remove
webpackand@angular-devkit/build-angularfrom peer dependencies and optional dependencies (#973) (ce7fc60)
9.0.4 (2021-06-15)
Bug Fixes
9.0.3 (2021-06-08)
Bug Fixes
- add missing
@angular/platform-browser-dynamicto peer dep (c1729e4)
9.0.2 (2021-06-06)
Bug Fixes
- allow ESM preset to be used in monorepo structure (#942) (b402e28)
- revert
exportsinpackage.json(#948) (928e08b), closes /github.com/thymikee/jest-preset-angular/issues/941#issuecomment-854580348
9.0.1 (2021-05-28)
Bug Fixes
9.0.0 (2021-05-27)
Bug Fixes
- support all node versions >= 12.13.0 (#923) (96782a6), closes #920
- presets: remove
moduleNameMapperconfig (#910) (df482bc), closes #908
Features
- support Jest 27 (#926) (1c761f8)
- config: load zone ESM when running jest in ESM mode (#892) (e03ec19), closes #751
- add
exportsfield topackage.json, see https://nodejs.org/api/packages.html#packages_package_entry_points - presets: add type definition for
presetsentry point (#801) (e4ff0c0) - compiler: support ESM (#721) (a2166f8)
- presets: add ESM preset (#723) (b0073b0)
- compiler: use
replace-resourcesAST transformer from Angular (#708) (1b20c19) - compiler: use
downlevel-ctorAST transformer from Angular (#730) (1f964c3)
Performance Improvements
- compiler: reuse
cacheFSfrom jest to reduce file system reading (#679) (f5d9d4b) - config: set
skipLibCheck: trueif not defined in tsconfig (#678) (0df3ce1)
BREAKING CHANGES
- Drop support for Angular < 9.0, see https://angular.io/guide/releases#support-policy-and-schedule.
- Drop support for Node.js version 10 since it becomes EOL on 2021-04-30. Required Node version now is >=12.13.0.
- Require Jest 27.
- Users who are using
import 'jest-preset-angular'should change toimport 'jest-preset-angular/setup-jest' - transformers: The AST transformers
InlineFilesTransformerandStripStylesTransformerare REMOVED and defaultjest-preset-angularuses AST transformers from@angular/compiler-cliand@ngtools/webpack. One should remove the old transformers from the jest config. - compiler:
jest-preset-angularnow switches to default to use its own transformer which wraps aroundts-jestto transform codes.
Users who are currently doing in jest config
// jest.config.js
module.exports = {
// [...]
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest',
},
}
should change to
// jest.config.js
module.exports = {
// [...]
transform: {
'^.+\\.(ts|js|html)$': 'jest-preset-angular',
},
}
- serializers:: snapshot serializer paths have been changed:
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js'is changed to'jest-preset-angular/build/serializers/no-ng-attributes.'jest-preset-angular/build/AngularSnapshotSerializer.js'is changed to'jest-preset-angular/build/serializers/ng-snapshot.'jest-preset-angular/build/HTMLCommentSerializer.js'is changed to'jest-preset-angular/build/serializers/html-comment.
- When generating a new project from Angular CLI, by default the
tsconfig.jsondoesn't contain any path mappings hence removingmoduleNameMapperfrom preset will make sure that the preset works in pair withtsconfig.json. Ones who are relying on the value ofmoduleNameMapperfrom the preset should create their ownmoduleNameMapperconfig manually or viats-jestutil https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping.
If you wish to reuse the old configuration of moduleNameMapper, you can put this into your Jest config
moduleNameMapper: {
'^src/(.*)$': '<rootDir>/src/$1',
'^app/(.*)$': '<rootDir>/src/app/$1',
'^assets/(.*)$': '<rootDir>/src/assets/$1',
'^environments/(.*)$': '<rootDir>/src/environments/$1',
}
- By default, if
skipLibCheckis not defined in tsconfig,jest-preset-angularwill set it totrue. If one wants to have it asfalse, one can set explicitly in tsconfig. - compiler:
jest-preset-angularnow switches to default to use its own transformer which wraps aroundts-jestto transform codes.
Users who are currently doing in jest config
// jest.config.js
module.exports = {
// [...]
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest',
},
}
should change to
// jest.config.js
module.exports = {
// [...]
transform: {
'^.+\\.(ts|js|html)$': 'jest-preset-angular',
},
}
9.0.0-next.14 (2021-05-05)
Bug Fixes
BREAKING CHANGES
When generating a new project from Angular CLI, by default the tsconfig.json doesn't contain any path mappings hence removing moduleNameMapper from preset will make sure that the preset works in pair with tsconfig.json.
Ones who are relying on the value of moduleNameMapper from the preset should create their own moduleNameMapper config manually or via ts-jest util https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping
9.0.0-next.13 (2021-04-18)
BREAKING CHANGES
- Drop support for Node.js version 10 since it becomes EOL on 2021-04-30. To support Angular 12, Node.js 12.13+ or 14.15+ is required.
9.0.0-next.12 (2021-03-31)
Bug Fixes
9.0.0-next.11 (2021-03-21)
Features
BREAKING CHANGES
- add
exportsfield topackage.json, see https://nodejs.org/api/packages.html#packages_package_entry_points
8.4.0 (2021-03-04)
Features
DEPRECATIONS
- Import serializer via
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js'is deprecated in favor of'jest-preset-angular/build/serializers/no-ng-attributes' - Import serializer via
'jest-preset-angular/build/AngularSnapshotSerializer.js'is deprecated in favor of'jest-preset-angular/build/serializers/ng-snapshot' - Import serializer via
'jest-preset-angular/build/HTMLCommentSerializer.js'is deprecated in favor of'jest-preset-angular/build/serializers/html-comment' - Import setup file via
import 'jest-preset-angular'is deprecated in favor ofimport 'jest-preset-angular/setup-jest'
9.0.0-next.8 (2021-02-12)
Features
- compiler: use constructor downlevel ctor transformer for
isolatedModules: true(#792) (00c71ce) - presets: add type definition for
presetsentry point (#801) (e4ff0c0)
9.0.0-next.6 (2021-01-14)
Features
- compiler: support ESM for
isolatedModules: false(#721) (a2166f8) - compiler: use
replace-resourcesforisolatedModules: true(#717) (76c25d2) - presets: add ESM preset (#723) (b0073b0)
9.0.0-next.5 (2021-01-06)
Features
- compiler: use
replace-resourcestransformer from Angular (#708) (1b20c19) - utils: add
es2015tongccscript's properties (#701) (a13070b)
BREAKING CHANGES
isolatedModules: truewill useinline-filesandstrip-stylestransformers as default transformers.isolatedModules: falsewill usereplace-resourcestransformer from@ngtools/webpack(besides the existingdownlevel-ctortransformer). This will makejest-preset-angularbecome closer to what Angular CLI does with Karma + Jasmine.- For users who migrate from v8.3.2 to 9.0.0, any references to
'jest-preset-angular/build/InlineFilesTransformer'and'jest-preset-angular/build/StripStylesTransformer'should be removed from jest config. - For users who migrate from 9.0.0-next.4, any references to
jest-preset-angular/build/transformers/inline-filesandjest-preset-angular/build/transformers/inline-filesshould be removed from jest config.
9.0.0-next.4 (2020-12-18)
Performance Improvements
- compiler: reuse
cacheFSfrom jest to reduce file system reading (#679) (f5d9d4b) - config: set
skipLibCheck: trueif not defined in tsconfig (#678) (0df3ce1)
BREAKING CHANGES
- By default, if
skipLibCheckis not defined in tsconfig,jest-preset-angularwill set it totrue. If one wants to have it asfalse, one can set explicitly in tsconfig. - Require Jest 27
9.0.0-next.1 (2020-10-29)
BREAKING CHANGES
- compiler:
jest-preset-angularnow switches to default to use its own transformer which wraps aroundts-jestto transform codes.
Users who are currently doing in jest config
// jest.config.js
module.exports = {
// [...]
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest',
},
}
should change to
// jest.config.js
module.exports = {
// [...]
transform: {
'^.+\\.(ts|js|html)$': 'jest-preset-angular',
},
}
8.3.2 (2020-10-23)
Chores
- config: switch to
tsconfigforjest-preset.js
9.0.0-next.0 (2020-10-18)
Chore
BREAKING CHANGES
We are working on Ivy compatibility for this preset. This requires introducing a different Jest transformer than the default
one from ts-jest. To get updates on this work, please subscribe to #409
- Users who are using
import 'jest-preset-angular'should change toimport 'jest-preset-angular/setup-jest' - Drop support for Angular < 8.0, see https://angular.io/guide/releases#support-policy-and-schedule
- transformers: The AST transformers
InlineFilesTransformerandStripStylesTransformerare REMOVED and defaultjest-preset-angularuses AST transformers from@angular/compiler-cli. One should remove the old transformers from the jest config. - serializers: One is using all
jest-preset-angularsnapshot serializers should change jest config to have:
// jest.config.js
const jestPresetAngularSerializers = require('jest-preset-angular/build/serializers')
module.exports = {
// [...]
snapshotSerializers: jestPresetAngularSerializers,
}
One is using one of jest-preset-angular snapshot serializers should change jest config to have:
// jest.config.js
module.exports = {
// [...]
snapshotSerializers: [
'jest-preset-angular/build/serializers/html-comment'
]
}
or
// package.json
{
// [...]
"jest": {
snapshotSerializers: [
"jest-preset-angular/build/serializers/html-comment"
]
}
}
8.3.1 (2020-08-23)
Bug Fixes
- Correct wrong published content in v8.3.0
8.3.0 (2020-08-23)
Features
Bug Fixes
8.2.1 (2020-06-19)
Features
8.2.0 (2020-05-07)
Features
8.1.3 (2020-03-31)
Features
8.1.2 (2020-03-15)
Bug Fixes
8.1.1 (2020-03-12)
Bug Fixes
8.1.0 (2020-03-10)
Bug Fixes
8.0.0 (2019-10-21)
Features
- breaking: Refine ast-transformer behavior: only transform
styles-assignments inside @Component (#261) and TypeScript v2.9createStringLiteralis polyfilled if an older version is used (#272). - breaking: Restructure project with
srcandbuildfolder (#307). - breaking: Support
tsconfig.spec.jsonin root folder by default (#309). - breaking: Enable
AngularNoAngularNoNgAttributesSnapshotSerializer(created in #97) by default (#318). - Remove
core-jsdependency by using internal, minimalreflect-metadata(#315).
Chores
- Update jsdom to current version 15 (#318).
BREAKING CHANGES
- If the
astTransformersare referenced in a customjestconfig,[ 'jest-preset-angular/build/InlineFilesTransformer', 'jest-preset-angular/build/StripStylesTransformer']have to be set instead. - Serializers, transformers and
setupJesthave to be referenced from thejest-preset-angular/build/-folder in a custom config. Existing references have to be aligned. - If your
tsconfig.spec.jsonis located insrc, move it to your root folder and adjust the referenced files and paths inside, or align your jest configuration as discussed in the README.md. - In an Angular 8 project or higher,
core-jsshould no longer be a dependency declared inpackage.json, unless it's imported manually in the code.
7.1.0 (2019-05-20)
Features
- component serializer without ng-* attributes (#97) (1079528)
- support
core-js>=2.0.0 < 4.0.0 (#246) (239a647)
Chores
- Fixed a CI cache issue in the example app, which would not always use the current version of the preset in the test runs.
7.0.0 (2019-03-08)
Bug Fixes
Features
- adjust semver range of
jest-zone-patch(#209) (1c60de7) - Import jest-zone-patch (#214) (66987ed), closes /github.com/thymikee/jest-zone-patch/pull/9#issuecomment-445772763
- Jest 24 (#224) (7f7d0f4), closes #223
- jsdom-v13 (#229) (864440e), closes #216
- breaking: Implement
astTransformercompatible withts-jest23.10 (#204) (adad842), closes #195 #201 #201 #201
Chores
- Remove template literal character escaping, reverts #34
- Migrate CI config to CircleCI v2 (#212)
- docs: do not use
.babelrcfile but ratherbabel.config.js(#231) - docs: add
astTransformersin configuration example (#218)
BREAKING CHANGES
- If
globalandtransformare not set in your configuration injest.config.json,jest.config.jsorpackage.json, you are done. - If the
globalvalue of the configuration was overridden, adjust- The option
"__TRANSFORM_HTML__": trueis not required anymore. Instead the"stringifyContentPathRegex": "\\.html$"should be used inside thets-jest-configuration. - Change the assignment identifier from
tsConfigFiletotsConfig. - Add the
astTransformers: [require.resolve('jest-preset-angular/InlineHtmlStripStylesTransformer')]so Jest can work withtemplateUrl-assignments in Component decorators.
- The option
- If
transformwas overridden, remove the entry pointing atpreprocessor.jsand add"^.+\\.(ts|js|html)$": "ts-jest"to thetransform-object. - If in doubt, check the configuration example in
jest-preset.json.
6.0.1 (2018-09-19)
Bug Fixes
- restrict version of
ts-jestto ~23.1.3 (#196) (62673cf) - support backtick quoted
templateUrl(#182) (145c8ea)
Chores
- Add HeroesComponent example with mocked service provider (#110)
- docs: Adjust troubleshooting to support configuration with Angular 6 (#187)
6.0.0 (2018-08-03)
Features
- Compatibility with
jestv23 (#173)
5.2.3 (2018-06-26)
Bug Fixes
5.2.2 (2018-04-27)
Bug Fixes
- update
STYLE_URLS_REGEXto not break on multiple new lines (#139)
Chores
5.2.1 (2018-03-08)
Bug Fixes
- update
ts-jestto22.4.1– urgent fix forenableTsDiagnostics(#130)
Chores
- Change
testRegextotestMatch(#131)
5.2.0 (2018-02-26)
Chores
- Upgrade ts-jest and remove
mapCoveragefromjest-preset(requiresjest@^22.4.0as a dependency now) (#127)
5.1.0 (2018-02-22)
Features
- Simplify installation by adding @types/jest as a package dependency (#116)
- Move serializers setup to jest config to be possible to override them (#126)
Chores
- docs: Add a configuration section with vendor libraries like jQuery (#117)
5.0.0 (2017-12-21)
Chores
- Get rid of explicit
jsdomdependency and custom test environment
BREAKING CHANGES
4.0.2 (2017-12-11)
BREAKING CHANGES
- Change to MIT license (#102)
4.0.1 (2017-10-08)
Bug Fixes
- Add doctype to test envrionment (#78)
4.0.0 (2017-10-03)
Bug Fixes
fakeAsyncnot working withzone.js>= 0.8.11
Features
- Custom test environment with newest version of
jsdom(#75) - Use universal
zone.jsinstead of node-specific one (#76)
BREAKING CHANGES
- Drop Node 4 support (because of
jsdomupgrade
3.0.2 (2017-09-21)
Bug Fixes
- issues with
moduleNameMappernot overriding mappings (#53)
BREAKING CHANGES
- Upgrade
jestto 21 - Upgrade
ts-jestto 21 moduleNameMapperno longer maps absolute paths tosrcby default, you need to declare the mappings explicitly (#53)
2.0.5 (2017-07-07)
Bug Fixes
- Bump to
ts-jest20.0.7
2.0.4 (2017-06-13)
Bug Fixes
- Angular injection errors are now visible
- scape template literals special chars (#34)
2.0.0 (2017-05-07)
BREAKING CHANGES
- Upgrade to Jest 20
- Better snapshot rendering
1.2.0 (2017-04-29)
Features
- Support absolute URLs in
templateUrl
1.1.0 (2017-04-22)
Features
- Support snapshot testing (#24)
1.0.0 (2017-04-13)
BREAKING CHANGES
rxjsis no longer auto included (#18)
0.0.14 (2017-04-12)
Bug Fixes
- Bump
jest-zone-patchversion withzone.jspeer dependency
0.0.13 (2017-04-05)
Bug Fixes
- Overhaul regex for styleUrls (#10)
0.0.10 (2017-04-04)
Bug Fixes
- Improve global mocks
0.0.9 (2017-04-04)
Features
- Allow all folders within src for module resolution (#6)
0.0.8 (2017-04-04)
Bug Fixes
- Use
tsconfig.spec.jsoninstead oftsconfig.app.jsonas TS configuration for tests