jest-preset-angular 11.1.0 → 11.1.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 +10 -0
- package/build/ng-jest-transformer.js +11 -9
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [11.1.1](https://github.com/thymikee/jest-preset-angular/compare/v11.0.1...v11.1.1) (2022-02-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Performance Improvements
|
|
5
|
+
|
|
6
|
+
* **transformer:** cache checking `esbuild` result ([#1309](https://github.com/thymikee/jest-preset-angular/issues/1309)) ([3412142](https://github.com/thymikee/jest-preset-angular/commit/341214213786899e2b6722c8c97dcbc0cca5252c))
|
|
7
|
+
* **transformer:** leverage the `ts-jest` config set cache ([#1318](https://github.com/thymikee/jest-preset-angular/issues/1318)) ([d47d1eb](https://github.com/thymikee/jest-preset-angular/commit/d47d1ebdb9248f722408431eba0b061c82dbc127)), closes [#1311](https://github.com/thymikee/jest-preset-angular/issues/1311)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
1
11
|
# [11.1.0](https://github.com/thymikee/jest-preset-angular/compare/v11.0.1...v11.1.0) (2022-01-20)
|
|
2
12
|
|
|
3
13
|
|
|
@@ -9,6 +9,7 @@ const bs_logger_1 = require("bs-logger");
|
|
|
9
9
|
const ts_jest_transformer_1 = require("ts-jest/dist/ts-jest-transformer");
|
|
10
10
|
const ng_jest_compiler_1 = require("./compiler/ng-jest-compiler");
|
|
11
11
|
const ng_jest_config_1 = require("./config/ng-jest-config");
|
|
12
|
+
let useNativeEsbuild;
|
|
12
13
|
class NgJestTransformer extends ts_jest_transformer_1.TsJestTransformer {
|
|
13
14
|
constructor() {
|
|
14
15
|
var _a;
|
|
@@ -23,14 +24,15 @@ class NgJestTransformer extends ts_jest_transformer_1.TsJestTransformer {
|
|
|
23
24
|
},
|
|
24
25
|
targets: (_a = process.env.NG_JEST_LOG) !== null && _a !== void 0 ? _a : undefined,
|
|
25
26
|
}), "f");
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
if (useNativeEsbuild === undefined) {
|
|
28
|
+
try {
|
|
29
|
+
const esbuildCheckPath = require.resolve('@angular-devkit/build-angular/esbuild-check.js');
|
|
30
|
+
const { status, error } = (0, child_process_1.spawnSync)(process.execPath, [esbuildCheckPath]);
|
|
31
|
+
useNativeEsbuild = status === 0 && error === undefined;
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
useNativeEsbuild = false;
|
|
35
|
+
}
|
|
34
36
|
}
|
|
35
37
|
(0, tslib_1.__classPrivateFieldSet)(this, _NgJestTransformer_esbuildImpl, useNativeEsbuild ? require('esbuild') : require('esbuild-wasm'), "f");
|
|
36
38
|
}
|
|
@@ -41,7 +43,7 @@ class NgJestTransformer extends ts_jest_transformer_1.TsJestTransformer {
|
|
|
41
43
|
this._compiler = new ng_jest_compiler_1.NgJestCompiler(configSet, cacheFS);
|
|
42
44
|
}
|
|
43
45
|
process(fileContent, filePath, transformOptions) {
|
|
44
|
-
const configSet =
|
|
46
|
+
const configSet = super._configsFor(transformOptions);
|
|
45
47
|
if (path_1.default.extname(filePath) === '.mjs' ||
|
|
46
48
|
(/node_modules\/(.*.js$)/.test(filePath.replace(/\\/g, '/')) && !filePath.includes('tslib'))) {
|
|
47
49
|
(0, tslib_1.__classPrivateFieldGet)(this, _NgJestTransformer_ngJestLogger, "f").debug({ filePath }, 'process with esbuild');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-preset-angular",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.1",
|
|
4
4
|
"description": "Jest preset configuration for Angular projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"bs-logger": "^0.2.6",
|
|
50
|
-
"esbuild-wasm": "0.14.
|
|
50
|
+
"esbuild-wasm": "0.14.11",
|
|
51
51
|
"jest-environment-jsdom": "^27.0.0",
|
|
52
52
|
"pretty-format": "^27.0.0",
|
|
53
53
|
"ts-jest": "^27.0.0"
|
|
54
54
|
},
|
|
55
55
|
"optionalDependencies": {
|
|
56
|
-
"esbuild": "0.14.
|
|
56
|
+
"esbuild": "0.14.11"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@angular-devkit/build-angular": ">=0.1002.4",
|
|
@@ -62,20 +62,20 @@
|
|
|
62
62
|
"@angular/platform-browser-dynamic": ">=10.0.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@angular-devkit/build-angular": "~13.
|
|
66
|
-
"@angular/animations": "~13.
|
|
67
|
-
"@angular/common": "~13.
|
|
68
|
-
"@angular/compiler": "~13.
|
|
69
|
-
"@angular/compiler-cli": "~13.
|
|
70
|
-
"@angular/core": "~13.
|
|
71
|
-
"@angular/platform-browser": "~13.
|
|
72
|
-
"@angular/platform-browser-dynamic": "~13.
|
|
65
|
+
"@angular-devkit/build-angular": "~13.2.3",
|
|
66
|
+
"@angular/animations": "~13.2.2",
|
|
67
|
+
"@angular/common": "~13.2.2",
|
|
68
|
+
"@angular/compiler": "~13.2.2",
|
|
69
|
+
"@angular/compiler-cli": "~13.2.2",
|
|
70
|
+
"@angular/core": "~13.2.2",
|
|
71
|
+
"@angular/platform-browser": "~13.2.2",
|
|
72
|
+
"@angular/platform-browser-dynamic": "~13.2.2",
|
|
73
73
|
"@commitlint/cli": "^16.0.1",
|
|
74
74
|
"@commitlint/config-angular": "^16.0.0",
|
|
75
|
-
"@jest/transform": "^27.
|
|
76
|
-
"@jest/types": "^27.
|
|
75
|
+
"@jest/transform": "^27.5.1",
|
|
76
|
+
"@jest/types": "^27.5.1",
|
|
77
77
|
"@types/jest": "^27.0.2",
|
|
78
|
-
"@types/node": "^16.11.
|
|
78
|
+
"@types/node": "^16.11.24",
|
|
79
79
|
"@types/semver": "^7.3.9",
|
|
80
80
|
"@typescript-eslint/eslint-plugin": "^5.9.1",
|
|
81
81
|
"@typescript-eslint/parser": "^5.9.1",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"eslint": "^8.7.0",
|
|
86
86
|
"eslint-config-prettier": "^8.3.0",
|
|
87
87
|
"eslint-plugin-import": "^2.25.2",
|
|
88
|
-
"eslint-plugin-jest": "^
|
|
89
|
-
"eslint-plugin-jsdoc": "^37.
|
|
88
|
+
"eslint-plugin-jest": "^26.0.0",
|
|
89
|
+
"eslint-plugin-jsdoc": "^37.9.0",
|
|
90
90
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
91
91
|
"eslint-plugin-prettier": "^4.0.0",
|
|
92
92
|
"execa": "5.1.1",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"github-files-fetcher": "^1.6.0",
|
|
95
95
|
"glob": "^7.1.7",
|
|
96
96
|
"husky": "^7.0.2",
|
|
97
|
-
"jest": "^27.
|
|
97
|
+
"jest": "^27.5.1",
|
|
98
98
|
"jest-snapshot-serializer-raw": "^1.2.0",
|
|
99
99
|
"pinst": "^2.1.6",
|
|
100
100
|
"prettier": "^2.5.1",
|