From 6997b0bc2020e8b7d88d55a107f03c60f8ab8ee1 Mon Sep 17 00:00:00 2001 From: "K. Golbang" Date: Mon, 7 Nov 2022 12:34:03 +0100 Subject: [PATCH] fix(serializers): remove `__ngContext__` from snapshots (#1816) --- .../__tests__/__snapshots__/foo.component.spec.ts.snap | 1 - src/serializers/ng-snapshot.ts | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/snapshot-serializers/__tests__/__snapshots__/foo.component.spec.ts.snap b/e2e/snapshot-serializers/__tests__/__snapshots__/foo.component.spec.ts.snap index 9b7d6fb886..978fdb5cb1 100644 --- a/e2e/snapshot-serializers/__tests__/__snapshots__/foo.component.spec.ts.snap +++ b/e2e/snapshot-serializers/__tests__/__snapshots__/foo.component.spec.ts.snap @@ -2,7 +2,6 @@ exports[`snapshot should work 1`] = ` string; type Printer = (elementToSerialize: unknown) => string; +const attributesToRemovePatterns = ['__ngContext__']; const ivyEnabled = (): boolean => { // Should be required lazily, since it will throw an exception // `Cannot resolve parameters...`. @@ -66,7 +67,7 @@ const print = (fixture: unknown, print: Printer, indent: Indent, opts: PluginOpt .map((node: VEDebugNode) => Array.from(node.renderElement.childNodes).map(print).join('')) .join(opts.edgeSpacing); } - const attributes = Object.keys(componentInstance); + const attributes = Object.keys(componentInstance).filter((key) => !attributesToRemovePatterns.includes(key)); if (attributes.length) { componentAttrs += attributes .sort()