Skip to content

Commit

Permalink
thymikee#1815 put removable patterns (__ngContext__) into a list
Browse files Browse the repository at this point in the history
  • Loading branch information
jepetko committed Nov 4, 2022
1 parent 47da3da commit f5e7681
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/serializers/ng-snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ interface PluginOptions {
type Indent = (indentSpaces: string) => 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...`.
Expand Down Expand Up @@ -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).filter((key) => key !== '__ngContext__');
const attributes = Object.keys(componentInstance).filter((key) => !attributesToRemovePatterns.includes(key));
if (attributes.length) {
componentAttrs += attributes
.sort()
Expand Down

0 comments on commit f5e7681

Please sign in to comment.