enzymejs / enzyme-matchers

Jasmine/Jest assertions for enzyme
MIT License
892 stars 115 forks source link

Rename toContainReact #328

Open mvasin opened 4 years ago

mvasin commented 4 years ago

toContainReact looks like an irrelevant name to me.

An instance of a component <MyComponent /> (as opposed to the component itself function MyComponent() {}) according to React core team blog should be called Element. So the name could be toContainElement, but there is already toContainMatchingElement, so it will look confusing.

Anyway, toContainReact doesn't look like an appropriate name, let's come up with a better one. Maybe toContainComponentInstance.

blainekasten commented 4 years ago

@mvasin you are absolutely right.

It seems like what is proper would be the following breaking changes:

toMatchElement and toMatchSelector already have the right syntax and it should be standardized. Would you be willing to make these changes for us?

mvasin commented 4 years ago

It's great to see your support! I'll be happy to do it.

blainekasten commented 4 years ago

Thanks @mvasin! Of course. I've felt weird about some of these APIs but hadn't given it much thought lately.