Open GreenGremlin opened 4 years ago
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?
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+).
Is there anything I can do to help get this merged?
Closing this PR, due to its age, but it would still be nice to have.
Age shouldn’t be a factor :-) let’s leave this open.
This PR is a follow-on to https://github.com/FormidableLabs/enzyme-matchers/pull/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 ahostNodes
method that filters a result set to just "host nodes". According to thehostNodes
documentation, "host nodes" are "are HTML elements rather than custom React components, e.g.<div>
versus<MyComponent>
."