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

Added .shallow() method to ShallowWrapper #16

Merged
merged 1 commit into from
Nov 16, 2015

Conversation

lelandrichardson
Copy link
Collaborator

cc: @ljharb

Implementing as discussed in #9

@ljharb
Copy link
Member

ljharb commented Nov 15, 2015

This looks great - but now I'm wondering if perhaps we'd want to auto-shallow-render? ie, every time you .find, the nodes in a shallow-rendered collection are shallow-rendered. What would be the downsides?

@lelandrichardson
Copy link
Collaborator Author

I briefly considered this. This isn't actually as possible as it sounds. And would have many drawbacks IMO even if it was.

The main thing is that you may actually need to stub out a lot of things to dive into a complex component. And it also encourages people to test behavior that's not actually part of the component.

Further, it is unclear how this would work. The shallow renderer is meant to be rendering one thing at a time. If you ran .find(Bar) and ended up finding 10 Bar instances, there's no clean way right now to have a "wrapper" around all 10 of them.

@ljharb
Copy link
Member

ljharb commented Nov 15, 2015

Gotcha - in that case, this approach seems best. :shipit:

lelandrichardson added a commit that referenced this pull request Nov 16, 2015
Added .shallow() method to ShallowWrapper
@lelandrichardson lelandrichardson merged commit 2c65f0d into master Nov 16, 2015
@lelandrichardson lelandrichardson deleted the lmr/shallow-method branch November 16, 2015 01:23
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