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

to satisfy: Improve diffs and support asserting textContent. #27

Merged
merged 2 commits into from
Sep 10, 2015

Conversation

papandreou
Copy link
Member

No description provided.

@papandreou papandreou changed the title to satisfy: Implement support for textContent. to satisfy: Improve diffs and support asserting textContent. Sep 10, 2015
@papandreou
Copy link
Member Author

The Travis failure seems bogus, any idea @Munter?

@Munter
Copy link
Member

Munter commented Sep 10, 2015

Looks like just a temporary glitch. Rerunning it worked

@Munter
Copy link
Member

Munter commented Sep 10, 2015

The changes look great. Thanks!

Munter added a commit that referenced this pull request Sep 10, 2015
to satisfy: Improve diffs and support asserting textContent.
@Munter Munter merged commit fc04e7a into unexpectedjs:master Sep 10, 2015
@Munter
Copy link
Member

Munter commented Sep 10, 2015

Published in 1.3.0

@sunesimonsen
Copy link
Member

@Munter awesome, this plugin is tremendously useful. It is the first time I'm using it.

@sunesimonsen
Copy link
Member

@Munter I was trying to achieve this: https://github.com/One-com/knockout.autocomplete/blob/master/test/knockout.autocomplete.spec.js#L37-L63 and ran into a very weird diff :-)

@Munter
Copy link
Member

Munter commented Sep 10, 2015

Seeing deep structures like that makes me want to enable html syntax in the comparison, like what @bruderstein is doing in https://github.com/bruderstein/unexpected-react-shallow

Unfortunately not as easy in actual dom versus virtual dom

@sunesimonsen
Copy link
Member

@Munter I don't exactly understand what you mean, the html is syntax highlighted in the diff.

@Munter
Copy link
Member

Munter commented Sep 10, 2015

expect(node, 'to render as', '<div class="foo">bar</div>');

@sunesimonsen
Copy link
Member

@Munter is it <div class="foo">bar</div> you want highlighted?

@sunesimonsen
Copy link
Member

That assertion makes sense, it should parse the rhs as html and copy the lhs, trim and remove all empty text nodes and use to equal. Then I guess you'll get a nice diff.

@sunesimonsen
Copy link
Member

@Munter sorry I completely misunderstood you - you want jsx in you your tests, with highlighting in you editor right?

@Munter
Copy link
Member

Munter commented Sep 10, 2015

Jsx, maybe. Html as a string might also be more readable. Means having to learn less of the specific syntax for the assertion

@sunesimonsen
Copy link
Member

Maybe the new strings in es6 would work in combination with an editor extension:

expect(node, 'to render as', html`<div class="foo">bar</div>`);

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.

None yet

3 participants