Skip to content

Commit

Permalink
Do not expose getRootNodeInternal
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 committed May 19, 2018
1 parent ea92903 commit dbf2e21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/enzyme-test-suite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.6.1"
}
}
}
10 changes: 5 additions & 5 deletions packages/enzyme/src/ShallowWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ function getRootNode(node) {
return node.rendered;
}

function getRootNodeInternal(wrapper) {
return wrapper[ROOT][NODE];
}

function privateSetNodes(wrapper, nodes) {
if (!Array.isArray(nodes)) {
privateSet(wrapper, NODE, nodes);
Expand Down Expand Up @@ -150,10 +154,6 @@ class ShallowWrapper {
return this[ROOT];
}

getRootNodeInternal() {
return this[ROOT][NODE];
}

getNodeInternal() {
if (this.length !== 1) {
throw new Error('ShallowWrapper::getNode() can only be called when wrapping one node');
Expand Down Expand Up @@ -803,7 +803,7 @@ class ShallowWrapper {
* @returns {ShallowWrapper}
*/
parents(selector) {
const allParents = this.wrap(this.single('parents', n => parentsOfNode(n, this.getRootNodeInternal())));
const allParents = this.wrap(this.single('parents', n => parentsOfNode(n, getRootNodeInternal(this))));
return selector ? allParents.filter(selector) : allParents;
}

Expand Down

0 comments on commit dbf2e21

Please sign in to comment.