Skip to content

Commit

Permalink
use children to tree
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Mar 5, 2018
1 parent e639849 commit 0af08cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/enzyme-adapter-react-16/src/ReactSixteenAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const FunctionalComponent = 1;
const HostPortal = 4;
const HostComponent = 5;
const HostText = 6;
const Mode = 11;
const ContextConsumer = 12;
const ContextProvider = 13;

Expand Down Expand Up @@ -74,10 +75,6 @@ function toTree(vnode) {
return toTree(node.child);
case HostPortal: // 4
return toTree(node.child);
case ContextProvider:
return toTree(node.child);
case ContextConsumer:
return toTree(node.child);
case ClassComponent:
return {
nodeType: 'class',
Expand All @@ -88,8 +85,6 @@ function toTree(vnode) {
instance: node.stateNode,
rendered: childrenToTree(node.child),
};
case Fragment: // 10
return childrenToTree(node.child);
case FunctionalComponent: // 1
return {
nodeType: 'function',
Expand Down Expand Up @@ -117,6 +112,11 @@ function toTree(vnode) {
}
case HostText: // 6
return node.memoizedProps;
case Fragment: // 10
case Mode: // 11
case ContextProvider: // 13
case ContextConsumer: // 12
return childrenToTree(node.child);
default:
throw new Error(`Enzyme Internal Error: unknown node with tag ${node.tag}`);
}
Expand Down

0 comments on commit 0af08cc

Please sign in to comment.