Skip to content

Conversation

@armsteadj1
Copy link
Contributor

@armsteadj1 armsteadj1 commented May 11, 2018

(the first level components)

Fixes #218.

@ljharb ljharb changed the title shallow render error messages now only show components under test (th… shallow render error messages now only show components under test May 11, 2018

html () {
return this.wrapper.html()
return this.wrapper.debug().replace(/\n(\s*)/g, '')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the .replace for?

Copy link
Contributor Author

@armsteadj1 armsteadj1 May 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I updated it to debug() a few of the html() tests were failing:

AssertionError: expected the node in <Fixture /> to be '<span id="child">Test</span>', but it was '<span id="child">\n  Test\n</span>'      

This change removed that extra padding and the \n's to get them to match what they use to be. I took the regex from the jest-enzyme link I posted in the #218.

Let me know if you'd rather it be the other way and I can update those tests and remove the regex!

@armsteadj1
Copy link
Contributor Author

How does one get a pull request merged in and pushed out as a new version to npm? 😄

@gunnari-turo
Copy link

Any update on getting this merged and a new version created @ayrton or @ljharb?

@ayrton ayrton merged commit 93ad641 into enzymejs:master Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants