jest-preset-angular 16.1.0 → 16.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 +9 -0
- package/build/serializers/ng-snapshot.js +12 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [16.1.1](https://github.com/thymikee/jest-preset-angular/compare/v16.1.0...v16.1.1) (2026-02-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* make snapshot serializer compatible with Signal Forms ([#3572](https://github.com/thymikee/jest-preset-angular/issues/3572)) ([7010730](https://github.com/thymikee/jest-preset-angular/commit/70107300b9644cb45af90199064cf34f803fd60f)), closes [#3560](https://github.com/thymikee/jest-preset-angular/issues/3560)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
# [16.1.0](https://github.com/thymikee/jest-preset-angular/compare/v16.0.0...v16.1.0) (2026-02-27)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -3,6 +3,17 @@ const attributesToRemovePatterns = ['__ngContext__'];
|
|
|
3
3
|
const removeTrailingWhiteSpaces = (serializedComponent) => {
|
|
4
4
|
return serializedComponent.replace(/\n^\s*\n/gm, '\n');
|
|
5
5
|
};
|
|
6
|
+
const serializeAttributeValue = (value) => {
|
|
7
|
+
try {
|
|
8
|
+
if (value && value?.constructor) {
|
|
9
|
+
return `{[Function ${value.constructor.name}]}`;
|
|
10
|
+
}
|
|
11
|
+
return `"${value}"`;
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return '{[Function Function]}';
|
|
15
|
+
}
|
|
16
|
+
};
|
|
6
17
|
const print = (fixture, printer, indent, opts, colors) => {
|
|
7
18
|
const { componentRef, componentInstance } = fixture;
|
|
8
19
|
const componentDef = componentRef.componentType.ɵcmp;
|
|
@@ -21,9 +32,7 @@ const print = (fixture, printer, indent, opts, colors) => {
|
|
|
21
32
|
return (opts.spacing +
|
|
22
33
|
indent(`${colors.prop.open}${attribute}${colors.prop.close}=`) +
|
|
23
34
|
colors.value.open +
|
|
24
|
-
(compAttrVal
|
|
25
|
-
? `{[Function ${compAttrVal.constructor.name}]}`
|
|
26
|
-
: `"${compAttrVal}"`) +
|
|
35
|
+
serializeAttributeValue(compAttrVal) +
|
|
27
36
|
colors.value.close);
|
|
28
37
|
})
|
|
29
38
|
.join('');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-preset-angular",
|
|
3
|
-
"version": "16.1.
|
|
3
|
+
"version": "16.1.1",
|
|
4
4
|
"description": "Jest preset configuration for Angular projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"fs-extra": "^11.3.3",
|
|
112
112
|
"github-files-fetcher": "^1.6.0",
|
|
113
113
|
"glob": "^13.0.6",
|
|
114
|
-
"globals": "^17.
|
|
114
|
+
"globals": "^17.3.0",
|
|
115
115
|
"husky": "^9.1.7",
|
|
116
116
|
"jest": "^30.2.0",
|
|
117
117
|
"jest-environment-jsdom": "^30.1.2",
|