Skip to content

Unclear why documentation uses wrapper.element for snapshots  #1606

Closed
@pattrickrice

Description

@pattrickrice

Documentation Feedback

Provide a brief summary of what you would like to see changed in our documentation.
Naively, for as long as I've been using this library I've been doing snapshot testing via

expect(wrapper).toMatchSnapshot()

however, the documentation without reasons shows

expect(wrapper.element).toMatchSnapshot()

while vuetify shows

expect(wrapper.html()).toMatchSnapshot()

It's not clear to me what the exact differences between the three are.

Feel free to provide any suggestions of content or examples you’d like us to include.
It would be nice to explain either the pros and cons of the different methods, or to just endorse one and say why explicitly.

Affected documentation page: Insert a link to the affected page
https://vue-test-utils.vuejs.org/guides/#testing-single-file-components-with-jest

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions