mzgoddard / preact-render-spy

Render preact components with access to the produced virtual dom for testing.
https://www.npmjs.com/package/preact-render-spy
ISC License
178 stars 24 forks source link

Added reduce() function for FindWrapper #63

Closed DzikowskiW closed 5 years ago

DzikowskiW commented 7 years ago

Resolves #62

gnarf commented 7 years ago

I really need to see a use case for this...

I'm having a hard time understanding why you'd want a reduce that does FindWrappers of the nodes... Map is an easy one for me, but reduce is getting a bit out there.

DzikowskiW commented 7 years ago

@gnarf there is actually a decent example in enzyme's documentation. I think .map() is much more useful and if you want to keep preact-render-spy's API a bit more constrained, .reduce() is not a necessity, but otherwise it helps once in a while.

If we decide to keep this function, I will add a better README example. Let me know what's your decision on that.

gnarf commented 6 years ago

If we decide to keep this function, I will add a better README example. Let me know what's your decision on that.

I think I need to see that example to want to keep the function :)