{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/250","repository_url":"https://api.github.com/repos/airbnb/enzyme","labels_url":"https://api.github.com/repos/airbnb/enzyme/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/enzyme/issues/250/comments","events_url":"https://api.github.com/repos/airbnb/enzyme/issues/250/events","html_url":"https://github.com/airbnb/enzyme/issues/250","id":140265093,"number":250,"title":"Mixed-depth shallow rendering mode","user":{"login":"lelandrichardson","id":1885623,"avatar_url":"https://avatars.githubusercontent.com/u/1885623?v=3","gravatar_id":"","url":"https://api.github.com/users/lelandrichardson","html_url":"https://github.com/lelandrichardson","followers_url":"https://api.github.com/users/lelandrichardson/followers","following_url":"https://api.github.com/users/lelandrichardson/following{/other_user}","gists_url":"https://api.github.com/users/lelandrichardson/gists{/gist_id}","starred_url":"https://api.github.com/users/lelandrichardson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lelandrichardson/subscriptions","organizations_url":"https://api.github.com/users/lelandrichardson/orgs","repos_url":"https://api.github.com/users/lelandrichardson/repos","events_url":"https://api.github.com/users/lelandrichardson/events{/privacy}","received_events_url":"https://api.github.com/users/lelandrichardson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/airbnb/enzyme/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-11T19:07:14Z","updated_at":"2016-03-11T21:27:49Z","closed_at":null,"body":"We could implement an option `expand` to `shallow` that allowed you to specify components that you'd like to \"expand\" the shallow render tree into, while all other components are considered leaf nodes.\r\n\r\n```\r\nfunction C() {\r\n  return <div className=\"d\" />\r\n}\r\nfunction C() {\r\n  return <div className=\"c\" />\r\n}\r\nfunction B(props) {\r\n  return (\r\n    <div className=\"b\">\r\n      <div>B</div>\r\n      {props.children}\r\n    </div>\r\n  );\r\n}\r\nfunction A(props) {\r\n  return (\r\n    <B>\r\n      <C />\r\n      <D />\r\n      {props.children}\r\n    </B>\r\n  );\r\n}\r\nconst wrapper = shallow(<A>Root</A>, { expand: [B, C] });\r\nwrapper.debug();\r\n```\r\nwould output something like this:\r\n```\r\n<A>\r\n  <B>\r\n    <div className=\"b\">\r\n      <div>B</div>\r\n      <C>\r\n        <div className=\"c\">A</div>\r\n      </C>\r\n      <D />\r\n      Root\r\n    </div>\r\n  </B>\r\n</A>\r\n```"},"comment":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/comments/195562358","html_url":"https://github.com/airbnb/enzyme/issues/250#issuecomment-195562358","issue_url":"https://api.github.com/repos/airbnb/enzyme/issues/250","id":195562358,"user":{"login":"sjdemartini","id":1647130,"avatar_url":"https://avatars.githubusercontent.com/u/1647130?v=3","gravatar_id":"","url":"https://api.github.com/users/sjdemartini","html_url":"https://github.com/sjdemartini","followers_url":"https://api.github.com/users/sjdemartini/followers","following_url":"https://api.github.com/users/sjdemartini/following{/other_user}","gists_url":"https://api.github.com/users/sjdemartini/gists{/gist_id}","starred_url":"https://api.github.com/users/sjdemartini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjdemartini/subscriptions","organizations_url":"https://api.github.com/users/sjdemartini/orgs","repos_url":"https://api.github.com/users/sjdemartini/repos","events_url":"https://api.github.com/users/sjdemartini/events{/privacy}","received_events_url":"https://api.github.com/users/sjdemartini/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T21:27:49Z","updated_at":"2016-03-11T21:27:49Z","body":"I like that this solution allows the user to specify which components should be shallow rendered in the subtree (compared to #249), which is useful for keeping the spec more isolate. However, #249 has the advantage that it will work for un-exported components in the root component's subtree, as are often used with stateless functional components. This will require that we export anything we want to `expand`, right?"}}