jest-preset-angular 12.2.1 → 12.2.3
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
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [12.2.2](https://github.com/thymikee/jest-preset-angular/compare/v12.2.1...v12.2.2) (2022-08-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* include `ts_compatibility/src` when publishing the package ([#1747](https://github.com/thymikee/jest-preset-angular/issues/1747)) ([26f021f](https://github.com/thymikee/jest-preset-angular/commit/26f021f65777661db83692115cb7976c656f1503)), closes [#1743](https://github.com/thymikee/jest-preset-angular/issues/1743)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
## [12.2.1](https://github.com/thymikee/jest-preset-angular/compare/v12.2.0...v12.2.1) (2022-08-28)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.combineModifiers = exports.getModifiers = exports.getDecorators = exports.updateConstructorDeclaration = exports.createSetAccessorDeclaration = exports.updateSetAccessorDeclaration = exports.createGetAccessorDeclaration = exports.updateGetAccessorDeclaration = exports.createPropertyDeclaration = exports.updatePropertyDeclaration = exports.createMethodDeclaration = exports.updateMethodDeclaration = exports.createClassDeclaration = exports.updateClassDeclaration = exports.updateImportDeclaration = exports.updateParameterDeclaration = void 0;
|
|
11
|
+
const tslib_1 = require("tslib");
|
|
12
|
+
const typescript_1 = tslib_1.__importDefault(require("typescript"));
|
|
13
|
+
const IS_AFTER_TS_48 = isAfterVersion(4, 8);
|
|
14
|
+
exports.updateParameterDeclaration = IS_AFTER_TS_48 ?
|
|
15
|
+
typescript_1.default.factory.updateParameterDeclaration :
|
|
16
|
+
(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) => typescript_1.default.factory.updateParameterDeclaration(node, ...splitModifiers(modifiers), dotDotDotToken, name, questionToken, type, initializer);
|
|
17
|
+
exports.updateImportDeclaration = IS_AFTER_TS_48 ?
|
|
18
|
+
typescript_1.default.factory.updateImportDeclaration :
|
|
19
|
+
(node, modifiers, importClause, moduleSpecifier, assertClause) => typescript_1.default.factory.updateImportDeclaration(node, undefined, modifiers, importClause, moduleSpecifier, assertClause);
|
|
20
|
+
exports.updateClassDeclaration = IS_AFTER_TS_48 ?
|
|
21
|
+
typescript_1.default.factory.updateClassDeclaration :
|
|
22
|
+
(node, combinedModifiers, name, typeParameters, heritageClauses, members) => typescript_1.default.factory.updateClassDeclaration(node, ...splitModifiers(combinedModifiers), name, typeParameters, heritageClauses, members);
|
|
23
|
+
exports.createClassDeclaration = IS_AFTER_TS_48 ?
|
|
24
|
+
typescript_1.default.factory.createClassDeclaration :
|
|
25
|
+
(combinedModifiers, name, typeParameters, heritageClauses, members) => typescript_1.default.factory.createClassDeclaration(...splitModifiers(combinedModifiers), name, typeParameters, heritageClauses, members);
|
|
26
|
+
exports.updateMethodDeclaration = IS_AFTER_TS_48 ?
|
|
27
|
+
typescript_1.default.factory.updateMethodDeclaration :
|
|
28
|
+
(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) => typescript_1.default.factory.updateMethodDeclaration(node, ...splitModifiers(modifiers), asteriskToken, name, questionToken, typeParameters, parameters, type, body);
|
|
29
|
+
exports.createMethodDeclaration = IS_AFTER_TS_48 ?
|
|
30
|
+
typescript_1.default.factory.createMethodDeclaration :
|
|
31
|
+
(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) => typescript_1.default.factory.createMethodDeclaration(...splitModifiers(modifiers), asteriskToken, name, questionToken, typeParameters, parameters, type, body);
|
|
32
|
+
exports.updatePropertyDeclaration = IS_AFTER_TS_48 ?
|
|
33
|
+
typescript_1.default.factory.updatePropertyDeclaration :
|
|
34
|
+
(node, modifiers, name, questionOrExclamationToken, type, initializer) => typescript_1.default.factory.updatePropertyDeclaration(node, ...splitModifiers(modifiers), name, questionOrExclamationToken, type, initializer);
|
|
35
|
+
exports.createPropertyDeclaration = IS_AFTER_TS_48 ?
|
|
36
|
+
typescript_1.default.factory.createPropertyDeclaration :
|
|
37
|
+
(modifiers, name, questionOrExclamationToken, type, initializer) => typescript_1.default.factory.createPropertyDeclaration(...splitModifiers(modifiers), name, questionOrExclamationToken, type, initializer);
|
|
38
|
+
exports.updateGetAccessorDeclaration = IS_AFTER_TS_48 ?
|
|
39
|
+
typescript_1.default.factory.updateGetAccessorDeclaration :
|
|
40
|
+
(node, modifiers, name, parameters, type, body) => typescript_1.default.factory.updateGetAccessorDeclaration(node, ...splitModifiers(modifiers), name, parameters, type, body);
|
|
41
|
+
exports.createGetAccessorDeclaration = IS_AFTER_TS_48 ?
|
|
42
|
+
typescript_1.default.factory.createGetAccessorDeclaration :
|
|
43
|
+
(modifiers, name, parameters, type, body) => typescript_1.default.factory.createGetAccessorDeclaration(...splitModifiers(modifiers), name, parameters, type, body);
|
|
44
|
+
exports.updateSetAccessorDeclaration = IS_AFTER_TS_48 ?
|
|
45
|
+
typescript_1.default.factory.updateSetAccessorDeclaration :
|
|
46
|
+
(node, modifiers, name, parameters, body) => typescript_1.default.factory.updateSetAccessorDeclaration(node, ...splitModifiers(modifiers), name, parameters, body);
|
|
47
|
+
exports.createSetAccessorDeclaration = IS_AFTER_TS_48 ?
|
|
48
|
+
typescript_1.default.factory.createSetAccessorDeclaration :
|
|
49
|
+
(modifiers, name, parameters, body) => typescript_1.default.factory.createSetAccessorDeclaration(...splitModifiers(modifiers), name, parameters, body);
|
|
50
|
+
exports.updateConstructorDeclaration = IS_AFTER_TS_48 ?
|
|
51
|
+
typescript_1.default.factory.updateConstructorDeclaration :
|
|
52
|
+
(node, modifiers, parameters, body) => typescript_1.default.factory.updateConstructorDeclaration(node, undefined, modifiers, parameters, body);
|
|
53
|
+
exports.getDecorators = IS_AFTER_TS_48 ? typescript_1.default.getDecorators : node => node.decorators;
|
|
54
|
+
exports.getModifiers = IS_AFTER_TS_48 ? typescript_1.default.getModifiers : node => node.modifiers;
|
|
55
|
+
function combineModifiers(decorators, modifiers) {
|
|
56
|
+
const hasDecorators = decorators === null || decorators === void 0 ? void 0 : decorators.length;
|
|
57
|
+
const hasModifiers = modifiers === null || modifiers === void 0 ? void 0 : modifiers.length;
|
|
58
|
+
if (hasDecorators && hasModifiers) {
|
|
59
|
+
return [...decorators, ...modifiers];
|
|
60
|
+
}
|
|
61
|
+
if (hasDecorators && !hasModifiers) {
|
|
62
|
+
return decorators;
|
|
63
|
+
}
|
|
64
|
+
if (hasModifiers && !hasDecorators) {
|
|
65
|
+
return modifiers;
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
exports.combineModifiers = combineModifiers;
|
|
70
|
+
function splitModifiers(allModifiers) {
|
|
71
|
+
if (!allModifiers) {
|
|
72
|
+
return [undefined, undefined];
|
|
73
|
+
}
|
|
74
|
+
const decorators = [];
|
|
75
|
+
const modifiers = [];
|
|
76
|
+
for (const current of allModifiers) {
|
|
77
|
+
if (typescript_1.default.isDecorator(current)) {
|
|
78
|
+
decorators.push(current);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
modifiers.push(current);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return [decorators.length ? decorators : undefined, modifiers.length ? modifiers : undefined];
|
|
85
|
+
}
|
|
86
|
+
function isAfterVersion(targetMajor, targetMinor) {
|
|
87
|
+
const [major, minor] = typescript_1.default.versionMajorMinor.split('.').map(part => parseInt(part));
|
|
88
|
+
if (major < targetMajor) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
return major === targetMajor ? minor >= targetMinor : true;
|
|
92
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-preset-angular",
|
|
3
|
-
"version": "12.2.
|
|
3
|
+
"version": "12.2.3",
|
|
4
4
|
"description": "Jest preset configuration for Angular projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -54,24 +54,24 @@
|
|
|
54
54
|
"esbuild": ">=0.13.8"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@angular-devkit/build-angular": ">=
|
|
58
|
-
"@angular/compiler-cli": ">=
|
|
59
|
-
"@angular/core": ">=
|
|
60
|
-
"@angular/platform-browser-dynamic": ">=
|
|
57
|
+
"@angular-devkit/build-angular": ">=12.2.18 <16.0.0",
|
|
58
|
+
"@angular/compiler-cli": ">=12.2.16 <16.0.0",
|
|
59
|
+
"@angular/core": ">=12.2.16 <16.0.0",
|
|
60
|
+
"@angular/platform-browser-dynamic": ">=12.2.16 <16.0.0",
|
|
61
61
|
"jest": "^28.0.0",
|
|
62
|
-
"typescript": ">=4.
|
|
62
|
+
"typescript": ">=4.4"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@angular-devkit/build-angular": "^
|
|
66
|
-
"@angular/animations": "^
|
|
67
|
-
"@angular/common": "^
|
|
68
|
-
"@angular/compiler": "^
|
|
69
|
-
"@angular/compiler-cli": "~
|
|
70
|
-
"@angular/core": "^
|
|
71
|
-
"@angular/platform-browser": "^
|
|
72
|
-
"@angular/platform-browser-dynamic": "^
|
|
73
|
-
"@commitlint/cli": "^17.
|
|
74
|
-
"@commitlint/config-angular": "^17.0
|
|
65
|
+
"@angular-devkit/build-angular": "^15.0.0",
|
|
66
|
+
"@angular/animations": "^15.0.0",
|
|
67
|
+
"@angular/common": "^15.0.0",
|
|
68
|
+
"@angular/compiler": "^15.0.0",
|
|
69
|
+
"@angular/compiler-cli": "~15.0.0",
|
|
70
|
+
"@angular/core": "^15.0.0",
|
|
71
|
+
"@angular/platform-browser": "^15.0.0",
|
|
72
|
+
"@angular/platform-browser-dynamic": "^15.0.0",
|
|
73
|
+
"@commitlint/cli": "^17.1.2",
|
|
74
|
+
"@commitlint/config-angular": "^17.1.0",
|
|
75
75
|
"@jest/transform": "^28.1.3",
|
|
76
76
|
"@jest/types": "^28.1.3",
|
|
77
77
|
"@types/jest": "^28.1.8",
|
|
@@ -100,9 +100,10 @@
|
|
|
100
100
|
"prettier": "^2.7.1",
|
|
101
101
|
"rimraf": "^3.0.2",
|
|
102
102
|
"rxjs": "^7.5.6",
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
103
|
+
"ts-node": "^10.9.1",
|
|
104
|
+
"tslib": "^2.4.1",
|
|
105
|
+
"typescript": "^4.8.4",
|
|
106
|
+
"zone.js": "^0.12.0"
|
|
106
107
|
},
|
|
107
108
|
"packageManager": "yarn@3.2.3"
|
|
108
109
|
}
|