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

Support matchers for equals or matchesElement #37

Closed
wdoug opened this issue Sep 9, 2016 · 5 comments
Closed

Support matchers for equals or matchesElement #37

wdoug opened this issue Sep 9, 2016 · 5 comments

Comments

@wdoug
Copy link

wdoug commented Sep 9, 2016

For enzyme .equals, it would be great to be able to write:

const wrapper = shallow(<span />);
expect(wrapper).toEqualNode(<span />);

instead of

const wrapper = shallow(<span />);
expect(highlightedText.equals(<span />)).toBe(true);

which gives no useful information on failure.

Or the equivalent with .matchesElement

@blainekasten
Copy link
Collaborator

That does sound like a good addition. I'm currently on paternity leave for
another month. If you want to put up a PR though I can try and get it
merged sooner than that!
On Fri, Sep 9, 2016 at 12:02 PM Willy Douglas notifications@github.com
wrote:

For enzyme .equals
http://airbnb.io/enzyme/docs/api/ShallowWrapper/equals.html, it would
be great to be able to write:

const wrapper = shallow();expect(wrapper).toEqualNode();

instead of

const wrapper = shallow();expect(highlightedText.equals()).toBe(true);

which gives no useful information on failure.

Or the equivalent with .matchesElement
http://airbnb.io/enzyme/docs/api/ShallowWrapper/matchesElement.html


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/blainekasten/jasmine-enzyme/issues/37, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ACx-t7z8KNuVRRaT86-S_XG-qw8Ln6SYks5qoZEegaJpZM4J5QOu
.

@cwmoo740
Copy link

@blainekasten
Copy link
Collaborator

Going to need a new PR. That one was closed and the project was reworked a lot.

@blainekasten
Copy link
Collaborator

@cwmoo740 @wdoug would either of you want to implement this?

@blainekasten
Copy link
Collaborator

closed by #95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants