+
Skip to content

Ignore (control flow) comments in Angular snapshot testing #1888

@HendrikN

Description

@HendrikN

Which scope/s are relevant/related to the feature request?

vitest-angular

Information

When using snapshot testing with Angular templates, the snapshots themselves would be cluttered with <!--container--> comments (originating from @if() statements and other control flow blocks). For example:

Image

As a result, when refactoring templates, the snapshot tests will fail when shuffling around if statements, even when the actual result does not differ.

Would there be support for a PR ignoring comments from snapshots? If so:

  • Should this behavior be an option?
  • Should all or only comments originating from NG control flow blocks be ignored?

Describe any alternatives/workarounds you're currently using

N/A

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载