Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrapper.html() formatting #498

Closed
tbuteler opened this issue Mar 29, 2021 · 1 comment · Fixed by #510
Closed

wrapper.html() formatting #498

tbuteler opened this issue Mar 29, 2021 · 1 comment · Fixed by #510
Labels
bug Something isn't working enhancement New feature or request

Comments

@tbuteler
Copy link
Contributor

I've got a bunch of tests that do something like this:

it('matches snapshot', () => {
    const wrapper = shallowMount(ExampleComponent)
    expect(wrapper.html()).toMatchSnapshot()
})

I've been trying out v2 and the snapshots all fail now because they were generated using v1, so my snapshotted HTML is all pretty-printed, whereas the wrapper.html() calls with v2 are not.

I was wondering if this was a regression, or if v2 is moving away from pretty-printing HTML (i.e. I should update my snapshots).

@lmiller1990
Copy link
Member

lmiller1990 commented Mar 30, 2021

Your snapshots will likely have some differences, but this seems like a regression. We should match v1 as closely as possible.

Would you like to make a PR fixing this? I'd recommend just copy-pasting in this file and using that in html by default.

@lmiller1990 lmiller1990 added bug Something isn't working enhancement New feature or request labels Mar 30, 2021
cexbrayat pushed a commit that referenced this issue Apr 2, 2021
Mimics v1 output by using "pretty" on HTML output before returning it from a wrapper.

Fixes #498
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants