jest-preset-angular 16.0.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 CHANGED
@@ -1,3 +1,21 @@
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
+
10
+ # [16.1.0](https://github.com/thymikee/jest-preset-angular/compare/v16.0.0...v16.1.0) (2026-02-27)
11
+
12
+
13
+ ### Features
14
+
15
+ * allow configuring platform providers for `TestBed` from setup env ([d11d79d](https://github.com/thymikee/jest-preset-angular/commit/d11d79d891433c82c67c52083e455084454cc1ea)), closes [#3590](https://github.com/thymikee/jest-preset-angular/issues/3590)
16
+
17
+
18
+
1
19
  # [16.0.0](https://github.com/thymikee/jest-preset-angular/compare/v15.0.3...v16.0.0) (2025-12-04)
2
20
 
3
21
 
@@ -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 && compAttrVal.constructor
25
- ? `{[Function ${compAttrVal.constructor.name}]}`
26
- : `"${compAttrVal}"`) +
35
+ serializeAttributeValue(compAttrVal) +
27
36
  colors.value.close);
28
37
  })
29
38
  .join('');