Skip to content

Commit e973f4b

Browse files
authored
chore(release): 9.0.0 (#932)
1 parent 1a56cff commit e973f4b

File tree

2 files changed

+98
-121
lines changed

2 files changed

+98
-121
lines changed

CHANGELOG.md

Lines changed: 95 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,148 @@
1-
# [9.0.0-next.14](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.13...v9.0.0-next.14) (2021-05-05)
1+
# [9.0.0](https://github.com/thymikee/jest-preset-angular/compare/v8.4.0...v9.0.0) (2021-05-27)
22

33

44
### Bug Fixes
55

6-
* remove warning message when installing `jest-preset-angular` for end users ([#911](https://github.com/thymikee/jest-preset-angular/issues/911)) ([7b7f5ba](https://github.com/thymikee/jest-preset-angular/commit/7b7f5bab63c295a01bc3bbd63ef8d58a847a1b17))
6+
* support all node versions >= **12.13.0** ([#923](https://github.com/thymikee/jest-preset-angular/issues/923)) ([96782a6](https://github.com/thymikee/jest-preset-angular/commit/96782a652821864576aa1cb96e57a39187172dd4)), closes [#920](https://github.com/thymikee/jest-preset-angular/issues/920)
77
* **presets:** remove `moduleNameMapper` config ([#910](https://github.com/thymikee/jest-preset-angular/issues/910)) ([df482bc](https://github.com/thymikee/jest-preset-angular/commit/df482bcb4c99b441f2fef8def04d10b8a1188deb)), closes [#908](https://github.com/thymikee/jest-preset-angular/issues/908)
8-
* **transformers:** revert [#903](https://github.com/thymikee/jest-preset-angular/issues/903) as some file extensions are not processed with their original content ([aebc186](https://github.com/thymikee/jest-preset-angular/commit/aebc186b7a8d7682a76aaa281f3c77ff51ae7475))
9-
10-
11-
## BREAKING CHANGES
12-
13-
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`.
148

15-
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
169

10+
### Features
1711

12+
* support **Jest 27** ([#926](https://github.com/thymikee/jest-preset-angular/issues/926)) ([1c761f8](https://github.com/thymikee/jest-preset-angular/commit/1c761f873686a96edeb4c3cb2f184d8a88f5f52a))
13+
* **config:** load zone ESM when running jest in ESM mode ([#892](https://github.com/thymikee/jest-preset-angular/issues/892)) ([e03ec19](https://github.com/thymikee/jest-preset-angular/commit/e03ec19c30b6ff257d0ddd7a8783d65ed5f43f8e)), closes [#751](https://github.com/thymikee/jest-preset-angular/issues/751)
14+
* add `exports` field to `package.json`, see https://nodejs.org/api/packages.html#packages_package_entry_points
15+
* **presets:** add type definition for `presets` entry point ([#801](https://github.com/thymikee/jest-preset-angular/issues/801)) ([e4ff0c0](https://github.com/thymikee/jest-preset-angular/commit/e4ff0c0e19e5941e7e7db1da9b5c29e01d58ab58))
16+
* **compiler:** support ESM ([#721](https://github.com/thymikee/jest-preset-angular/issues/721)) ([a2166f8](https://github.com/thymikee/jest-preset-angular/commit/a2166f859b1c89340ee889520595d05fa3cf65dc))
17+
* **presets:** add ESM preset ([#723](https://github.com/thymikee/jest-preset-angular/issues/723)) ([b0073b0](https://github.com/thymikee/jest-preset-angular/commit/b0073b0f3a7e24f06d136367a1c2e676ac76e59e))
18+
* **compiler:** use `replace-resources` AST transformer from Angular ([#708](https://github.com/thymikee/jest-preset-angular/issues/708)) ([1b20c19](https://github.com/thymikee/jest-preset-angular/commit/1b20c196586487a119f7e5e545c2a7fcfe6359fb))
19+
* **compiler:** use `downlevel-ctor` AST transformer from Angular ([#730](https://github.com/thymikee/jest-preset-angular/issues/730)) ([1f964c3](https://github.com/thymikee/jest-preset-angular/commit/c1242868557a95d79a7bb5a108153496e1f964c3))
1820

19-
# [9.0.0-next.13](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.12...v9.0.0-next.13) (2021-04-18)
2021

22+
### Performance Improvements
2123

22-
### Features
24+
* **compiler:** reuse `cacheFS` from jest to reduce file system reading ([#679](https://github.com/thymikee/jest-preset-angular/issues/679)) ([f5d9d4b](https://github.com/thymikee/jest-preset-angular/commit/f5d9d4b9c0b5440ab14ddb4a636ea84d384e3408))
25+
* **config:** set `skipLibCheck: true` if not defined in tsconfig ([#678](https://github.com/thymikee/jest-preset-angular/issues/678)) ([0df3ce1](https://github.com/thymikee/jest-preset-angular/commit/0df3ce159c6778893dc08e35bdb99d0f3e0285b5))
2326

24-
* allow css testing with `@Component` property `styles` ([#900](https://github.com/thymikee/jest-preset-angular/issues/900)) ([7cf86e0](https://github.com/thymikee/jest-preset-angular/commit/7cf86e006495c6b9f12f6eb274effc4f03ba97c5))
25-
* allow css testing with `@Component` property `styleUrls` ([#903](https://github.com/thymikee/jest-preset-angular/issues/903)) ([c275166](https://github.com/thymikee/jest-preset-angular/commit/c275166191e3e66be9bb1adc972a75c58650b32e))
2627

28+
## BREAKING CHANGES
2729

28-
### BREAKING CHANGES
30+
* Drop support for Angular < **8.0**, see https://angular.io/guide/releases#support-policy-and-schedule.
31+
* Drop support for Node.js version **10** since it becomes EOL on **2021-04-30**. Required Node version now is **>=12.13.0**.
32+
* Require **Jest 27**.
33+
* When generating a new project from Angular CLI, by default the `tsconfig.json` doesn't contain any path mappings
34+
hence removing `moduleNameMapper` from preset will make sure that the preset works in pair with `tsconfig.json`.
35+
Ones who are relying on the value of `moduleNameMapper` from the preset should create their own `moduleNameMapper`
36+
config manually or via `ts-jest` util https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping
37+
* By default, if `skipLibCheck` is not defined in tsconfig, `jest-preset-angular` will set it to `true`. If one wants to have it as `false`, one can set explicitly in tsconfig.
38+
* **compiler:** `jest-preset-angular` now switches to default to use its own transformer which wraps around `ts-jest` to transform codes.
2939

30-
* 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.
31-
* `jest-preset-angular` now allows testing with all Angular supported style extensions.
32-
33-
Users who are specifying in jest config
40+
Users who are currently doing in jest config
3441
```
42+
// jest.config.js
3543
module.exports = {
36-
globals: {
37-
'ts-jest': {
38-
tsconfig: '<rootDir>/tsconfig.spec.json',
39-
stringifyContentPathRegex: '\\.html$',
40-
},
41-
},
42-
transform: {
43-
'^.+\\.(ts|js|html)$': 'jest-preset-angular',
44-
},
44+
// [...]
45+
transform: {
46+
'^.+\\.(ts|js|html)$': 'ts-jest',
47+
},
4548
}
4649
```
4750

4851
should change to
52+
```
53+
// jest.config.js
54+
module.exports = {
55+
// [...]
56+
transform: {
57+
'^.+\\.(ts|js|html)$': 'jest-preset-angular',
58+
},
59+
}
60+
```
61+
* Users who are using `import 'jest-preset-angular'` should change to `import 'jest-preset-angular/setup-jest'`
62+
* **transformers:** The AST transformers `InlineFilesTransformer` and `StripStylesTransformer` are **REMOVED** and
63+
default `jest-preset-angular` uses AST transformers from `@angular/compiler-cli` and `@ngtools/webpack`.
64+
One should remove the old transformers from the jest config.
65+
* **serializers:** One is using all `jest-preset-angular` snapshot serializers should change jest config to have:
66+
```
67+
// jest.config.js
68+
const jestPresetAngularSerializers = require('jest-preset-angular/build/serializers')
69+
70+
module.exports = {
71+
// [...]
72+
snapshotSerializers: jestPresetAngularSerializers,
73+
}
74+
```
4975

76+
One is using one of `jest-preset-angular` snapshot serializers should change jest config to have:
5077
```
78+
// jest.config.js
5179
module.exports = {
52-
globals: {
53-
'ts-jest': {
54-
tsconfig: '<rootDir>/tsconfig.spec.json',
55-
stringifyContentPathRegex: '\\.(html|css|sass|scss|less|styl)$',
56-
},
57-
},
58-
transform: {
59-
'^.+\\.(ts|js|html|css|sass|scss|less|styl)$': 'jest-preset-angular',
60-
},
80+
// [...]
81+
snapshotSerializers: [
82+
'jest-preset-angular/build/serializers/html-comment'
83+
]
84+
}
85+
```
86+
or
87+
```
88+
// package.json
89+
{
90+
// [...]
91+
"jest": {
92+
snapshotSerializers: [
93+
"jest-preset-angular/build/serializers/html-comment"
94+
]
95+
}
6196
}
6297
```
6398

6499

65-
# [9.0.0-next.12](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.11...v9.0.0-next.12) (2021-03-31)
100+
101+
# [9.0.0-next.14](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.13...v9.0.0-next.14) (2021-05-05)
66102

67103

68104
### Bug Fixes
69105

70-
* define export path for `jest-preset` ([#896](https://github.com/thymikee/jest-preset-angular/issues/896)) ([218b217](https://github.com/thymikee/jest-preset-angular/commit/218b217c02d053ab98f476f26f716e95d407ac5c))
106+
* **presets:** remove `moduleNameMapper` config ([#910](https://github.com/thymikee/jest-preset-angular/issues/910)) ([df482bc](https://github.com/thymikee/jest-preset-angular/commit/df482bcb4c99b441f2fef8def04d10b8a1188deb)), closes [#908](https://github.com/thymikee/jest-preset-angular/issues/908)
71107

72108

73-
### Features
109+
## BREAKING CHANGES
110+
111+
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`.
74112

75-
* support jest **27.0.0-next.6** ([#897](https://github.com/thymikee/jest-preset-angular/issues/897)) ([eff3052](https://github.com/thymikee/jest-preset-angular/commit/eff30529995e97daadbdfa04de8f41cb0ff76a8f))
113+
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
76114

77115

78116

79-
# [9.0.0-next.11](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.10...v9.0.0-next.11) (2021-03-21)
117+
# [9.0.0-next.13](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.12...v9.0.0-next.13) (2021-04-18)
80118

81119

82-
### Features
120+
### BREAKING CHANGES
83121

84-
* **config:** load zone ESM when running jest in ESM mode ([#892](https://github.com/thymikee/jest-preset-angular/issues/892)) ([e03ec19](https://github.com/thymikee/jest-preset-angular/commit/e03ec19c30b6ff257d0ddd7a8783d65ed5f43f8e)), closes [#751](https://github.com/thymikee/jest-preset-angular/issues/751)
85-
* support jest **27.0.0-next.5** ([#891](https://github.com/thymikee/jest-preset-angular/issues/891)) ([7a6cb0a](https://github.com/thymikee/jest-preset-angular/commit/7a6cb0af3dbc7b98b48f6759a5c4d299791cd957))
122+
* 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.
86123

87124

88-
### BREAKING CHANGES
89125

90-
* add `exports` field to `package.json`, see https://nodejs.org/api/packages.html#packages_package_entry_points
126+
# [9.0.0-next.12](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.11...v9.0.0-next.12) (2021-03-31)
91127

92128

129+
### Bug Fixes
93130

94-
# [9.0.0-next.10](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.9...v9.0.0-next.10) (2021-03-11)
131+
* define export path for `jest-preset` ([#896](https://github.com/thymikee/jest-preset-angular/issues/896)) ([218b217](https://github.com/thymikee/jest-preset-angular/commit/218b217c02d053ab98f476f26f716e95d407ac5c))
132+
133+
134+
135+
# [9.0.0-next.11](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.10...v9.0.0-next.11) (2021-03-21)
95136

96137

97138
### Features
98139

99-
* adopt jest **27.0.0-next.4** ([#876](https://github.com/thymikee/jest-preset-angular/issues/876)) ([603b8ab](https://github.com/thymikee/jest-preset-angular/commit/603b8ab84b4d6345416a78810f409dc1c2d47f09))
140+
* **config:** load zone ESM when running jest in ESM mode ([#892](https://github.com/thymikee/jest-preset-angular/issues/892)) ([e03ec19](https://github.com/thymikee/jest-preset-angular/commit/e03ec19c30b6ff257d0ddd7a8783d65ed5f43f8e)), closes [#751](https://github.com/thymikee/jest-preset-angular/issues/751)
141+
142+
143+
### BREAKING CHANGES
144+
145+
* add `exports` field to `package.json`, see https://nodejs.org/api/packages.html#packages_package_entry_points
100146

101147

102148

@@ -117,38 +163,13 @@ module.exports = {
117163

118164

119165

120-
# [9.0.0-next.9](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.8...v9.0.0-next.9) (2021-02-26)
121-
122-
123-
### Features
124-
125-
* adopt `[email protected]` ([#843](https://github.com/thymikee/jest-preset-angular/issues/843)) ([1b9ef29](https://github.com/thymikee/jest-preset-angular/commit/1b9ef296e9c2e67277994dfc0da3b6a7a53f716b))
126-
127-
128-
129166
# [9.0.0-next.8](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.7...v9.0.0-next.8) (2021-02-12)
130167

131168

132169
### Features
133170

134171
* **compiler:** use constructor downlevel ctor transformer for `isolatedModules: true` ([#792](https://github.com/thymikee/jest-preset-angular/issues/792)) ([00c71ce](https://github.com/thymikee/jest-preset-angular/commit/00c71ceaa06e58432d201d9d5f8deb33e8f54665))
135172
* **presets:** add type definition for `presets` entry point ([#801](https://github.com/thymikee/jest-preset-angular/issues/801)) ([e4ff0c0](https://github.com/thymikee/jest-preset-angular/commit/e4ff0c0e19e5941e7e7db1da9b5c29e01d58ab58))
136-
* include features from `ts-jest` **27.0.0-next.6**
137-
* Revert the usage of Angular compiler and use `ts-jest` to transform codes for `isolatedModules: false` ([#800](https://github.com/thymikee/jest-preset-angular/pull/800)) ([e4c9677](https://github.com/thymikee/jest-preset-angular/commit/a9ad3efbee508b59a7fc450ec39099567e4c9677)), closes [#757](https://github.com/thymikee/jest-preset-angular/issues/757)
138-
139-
140-
141-
# [9.0.0-next.7](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.6...v9.0.0-next.7) (2021-01-29)
142-
143-
144-
### Bug Fixes
145-
146-
* **compiler:** update `SourceFile` with correct file content ([#765](https://github.com/thymikee/jest-preset-angular/issues/765)) ([c54e20a](https://github.com/thymikee/jest-preset-angular/commit/c54e20ab7ae9b7b08af827587dc30fd281291ecc)), closes [#764](https://github.com/thymikee/jest-preset-angular/issues/764)
147-
148-
149-
### Features
150-
151-
* include features from `ts-jest` [27.0.0-next.4](https://github.com/kulshekhar/ts-jest/blob/master/CHANGELOG.md#2700-next4-2021-01-22)
152173

153174

154175

@@ -184,17 +205,6 @@ module.exports = {
184205
# [9.0.0-next.4](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.0...v9.0.0-next.4) (2020-12-18)
185206

186207

187-
### Build System
188-
189-
* **devs-infra:** build package with target `es2015` ([#620](https://github.com/thymikee/jest-preset-angular/issues/620)) ([779fd8c](https://github.com/thymikee/jest-preset-angular/commit/779fd8c2f878d21587e24eda4121dc73166dfa53))
190-
191-
192-
### Features
193-
194-
* support Jest 27 ([#676](https://github.com/thymikee/jest-preset-angular/issues/676)) ([1a6b10e](https://github.com/thymikee/jest-preset-angular/commit/1a6b10ef66c266a7736f2ef4aed178db836d0c6c))
195-
* **utils:** improve `ngcc-jest-processor` util script to exclude some Jest args ([#662](https://github.com/thymikee/jest-preset-angular/issues/662)) ([cf1bb4c](https://github.com/thymikee/jest-preset-angular/commit/cf1bb4c36e1e68804658da02c6ca3a2bd783a6e2))
196-
197-
198208
### Performance Improvements
199209

200210
* **compiler:** reuse `cacheFS` from jest to reduce file system reading ([#679](https://github.com/thymikee/jest-preset-angular/issues/679)) ([f5d9d4b](https://github.com/thymikee/jest-preset-angular/commit/f5d9d4b9c0b5440ab14ddb4a636ea84d384e3408))
@@ -204,49 +214,16 @@ module.exports = {
204214
### BREAKING CHANGES
205215

206216
* By default, if `skipLibCheck` is not defined in tsconfig, `jest-preset-angular` will set it to `true`. If one wants to have it as `false`, one can set explicitly in tsconfig.
207-
* `jest-preset-angular` no longer ships with `es5` build but now with `es2015`
208217
* Require Jest 27
209218

210219

211220

212-
# [9.0.0-next.3](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.0...v9.0.0-next.3) (2020-11-17)
213-
214-
215-
### Bug Fixes
216-
217-
* **compiler:** fallback to ES2015 when no target is defined ([d8c4975](https://github.com/thymikee/jest-preset-angular/commit/d8c497515ac981d8903d9c37190be39bde60ca51)), closes [#622](https://github.com/thymikee/jest-preset-angular/issues/622)
218-
* add `@ngtools/webpack` to peerDependencies list ([003527d](https://github.com/thymikee/jest-preset-angular/commit/003527d5329461e3b9a5c17404d0b64553192234)), closes [#622](https://github.com/thymikee/jest-preset-angular/issues/622)
219-
220-
221-
### Features
222-
223-
* **compiler:** provide ngcc-jest-processor util ([5c6ae01](https://github.com/thymikee/jest-preset-angular/commit/5c6ae01a0ee665879b32b6b4a75270fc1acdb1db))
224-
225-
226-
227-
228-
# [9.0.0-next.2](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.0...v9.0.0-next.2) (2020-11-08)
229-
230-
231-
### Performance Improvements
232-
233-
* **compiler:** cache module resolution with custom compiler host ([22941cc](https://github.com/thymikee/jest-preset-angular/commit/22941ccf2a1fbf8e0c9893670ce6b9056be66534))
234-
* **compiler:** only include none test files when initializing `Program` ([4cc5a1a](https://github.com/thymikee/jest-preset-angular/commit/4cc5a1a7578d45801f7437f9816b11c4d92dfeca))
235-
236-
237-
238-
239221
# [9.0.0-next.1](https://github.com/thymikee/jest-preset-angular/compare/v9.0.0-next.0...v9.0.0-next.1) (2020-10-29)
240222

241223

242-
### Features
243-
244-
* **compiler:** introduce `NgJestCompiler` for code compilation ([02d272e](https://github.com/thymikee/jest-preset-angular/commit/02d272eb9ec4b14dbf1d2d620266750e1873abe6)), closes [#108](https://github.com/thymikee/jest-preset-angular/issues/108) [#288](https://github.com/thymikee/jest-preset-angular/issues/288) [#322](https://github.com/thymikee/jest-preset-angular/issues/322) [#353](https://github.com/thymikee/jest-preset-angular/issues/353)
245-
246-
247224
### BREAKING CHANGES
248225

249-
* **compiler:** With the new jest transformer, `jest-preset-angular` now switches to default to use this new transformer and no longer use `ts-jest` to transform codes.
226+
* **compiler:** `jest-preset-angular` now switches to default to use its own transformer which wraps around `ts-jest` to transform codes.
250227

251228
Users who are currently doing in jest config
252229
```
@@ -270,8 +247,6 @@ module.exports = {
270247
}
271248
```
272249

273-
`isolatedModule: true` will still use `ts-jest` to compile `ts` to `js` but you won't get full compatibility with Ivy.
274-
275250

276251

277252
## [8.3.2](https://github.com/thymikee/jest-preset-angular/compare/v8.3.1...v8.3.2) (2020-10-23)

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jest-preset-angular",
3-
"version": "9.0.0-next.14",
3+
"version": "9.0.0",
44
"description": "Jest preset configuration for Angular projects",
55
"license": "MIT",
66
"main": "build/index.js",
@@ -54,6 +54,8 @@
5454
"ts-jest": "^27.0.0"
5555
},
5656
"peerDependencies": {
57+
"@angular-devkit/build-angular": ">=0.901.12",
58+
"@angular/core": ">=9.0.0",
5759
"jest": "^27.0.0"
5860
},
5961
"optionalDependencies": {

0 commit comments

Comments
 (0)