jest-preset-angular 14.3.0 → 14.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -2
- package/README.md +2 -48
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [14.3.1](https://github.com/thymikee/jest-preset-angular/compare/v14.3.0...v14.3.1) (2024-11-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Documentation
|
|
5
|
+
|
|
6
|
+
* docs: simplify `README.md` about installation and configuration ([79ea18b](https://github.com/thymikee/jest-preset-angular/commit/79ea18b))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
## [14.3.0](https://github.com/thymikee/jest-preset-angular/compare/v14.2.4...v14.3.0) (2024-11-15)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -22,7 +31,7 @@ Please use "setupZoneTestEnv" function instead. Example:
|
|
|
22
31
|
For CJS
|
|
23
32
|
```
|
|
24
33
|
// setup-jest.ts
|
|
25
|
-
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env';
|
|
34
|
+
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
|
|
26
35
|
|
|
27
36
|
setupZoneTestEnv();
|
|
28
37
|
```
|
|
@@ -30,11 +39,13 @@ setupZoneTestEnv();
|
|
|
30
39
|
For ESM
|
|
31
40
|
```
|
|
32
41
|
// setup-jest.ts
|
|
33
|
-
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/index.mjs';
|
|
42
|
+
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone/index.mjs';
|
|
34
43
|
|
|
35
44
|
setupZoneTestEnv();
|
|
36
45
|
```
|
|
37
46
|
|
|
47
|
+
See more at https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
|
|
48
|
+
|
|
38
49
|
|
|
39
50
|
|
|
40
51
|
## [14.2.4](https://github.com/thymikee/jest-preset-angular/compare/v14.2.3...v14.2.4) (2024-09-12)
|
package/README.md
CHANGED
|
@@ -12,10 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
> This is a part of the article: [Testing Angular faster with Jest](https://www.xfive.co/blog/testing-angular-faster-jest/).
|
|
14
14
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
These instructions will get you setup to use `jest-preset-angular` in your project. For more detailed documentation,
|
|
18
|
-
please check [online documentation](https://thymikee.github.io/jest-preset-angular).
|
|
15
|
+
## Installation
|
|
19
16
|
|
|
20
17
|
Install using [`yarn`](https://yarnpkg.com/en/package/jest-preset-angular):
|
|
21
18
|
|
|
@@ -31,50 +28,7 @@ npm install -D jest jest-preset-angular @types/jest
|
|
|
31
28
|
|
|
32
29
|
## Configuration
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
import 'jest-preset-angular/setup-jest';
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Add the following section:
|
|
41
|
-
|
|
42
|
-
- to your root `jest.config.js`
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
// jest.config.js
|
|
46
|
-
module.exports = {
|
|
47
|
-
preset: 'jest-preset-angular',
|
|
48
|
-
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
|
|
49
|
-
globalSetup: 'jest-preset-angular/global-setup',
|
|
50
|
-
};
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
- or to your root `package.json`
|
|
54
|
-
|
|
55
|
-
```json
|
|
56
|
-
{
|
|
57
|
-
"jest": {
|
|
58
|
-
"preset": "jest-preset-angular",
|
|
59
|
-
"setupFilesAfterEnv": ["<rootDir>/setup-jest.ts"],
|
|
60
|
-
"globalSetup": "jest-preset-angular/global-setup"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Adjust your `tsconfig.spec.json` to be:
|
|
66
|
-
|
|
67
|
-
```json
|
|
68
|
-
{
|
|
69
|
-
"extends": "./tsconfig.json",
|
|
70
|
-
"compilerOptions": {
|
|
71
|
-
"outDir": "./out-tsc/spec",
|
|
72
|
-
"module": "CommonJs",
|
|
73
|
-
"types": ["jest"]
|
|
74
|
-
},
|
|
75
|
-
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
|
|
76
|
-
}
|
|
77
|
-
```
|
|
31
|
+
Check out our [Configuration guidance](https://thymikee.github.io/jest-preset-angular/docs/getting-started/installation).
|
|
78
32
|
|
|
79
33
|
**IMPORTANT**
|
|
80
34
|
|