Skip to content

Host node matchers#337

Open
GreenGremlin wants to merge 2 commits intoenzymejs:masterfrom
GreenGremlin:host-node-matchers
Open

Host node matchers#337
GreenGremlin wants to merge 2 commits intoenzymejs:masterfrom
GreenGremlin:host-node-matchers

Conversation

@GreenGremlin
Copy link
Copy Markdown
Contributor

@GreenGremlin GreenGremlin commented Feb 19, 2020

This PR is a follow-on to #336, until it is merged, this PR will also include changes from that PR.

This change adds three new matchers, similar to the existing toContainMatchingElement matchers, except that the new matchers only match against "host nodes". Enzyme v3.1 added a hostNodes method that filters a result set to just "host nodes". According to the hostNodes documentation, "host nodes" are "are HTML elements rather than custom React components, e.g. <div> versus <MyComponent>."

@GreenGremlin GreenGremlin force-pushed the host-node-matchers branch 2 times, most recently from e1534fb to 8752813 Compare February 19, 2020 01:56
@GreenGremlin
Copy link
Copy Markdown
Contributor Author

Given that hostNodes was added in Enzyme v3.1, should there be some safeguards around the new marchers? What versions of Enzyme are officially supported?

@GreenGremlin GreenGremlin force-pushed the host-node-matchers branch 2 times, most recently from bfc4e33 to e5beebc Compare February 19, 2020 17:54
@ljharb
Copy link
Copy Markdown
Member

ljharb commented Feb 26, 2020

I consider it a bug that enzyme-matchers does not declare a peerDependency range on enzyme. It's probably fine to publish these new matchers without guards (since nobody can already be using them), but after that's out, a breaking change should probably be published that adds a peerDep on enzyme v3.1+ (or even, v3.11+).

@GreenGremlin
Copy link
Copy Markdown
Contributor Author

Is there anything I can do to help get this merged?

@GreenGremlin
Copy link
Copy Markdown
Contributor Author

Closing this PR, due to its age, but it would still be nice to have.

@ljharb ljharb reopened this Aug 29, 2023
@ljharb
Copy link
Copy Markdown
Member

ljharb commented Aug 29, 2023

Age shouldn’t be a factor :-) let’s leave this open.

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.

2 participants