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 Feb 24, 2018
1 parent 013e85e commit bc092ae
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.5.1"
}
}
}
10 changes: 5 additions & 5 deletions packages/enzyme/src/ShallowWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,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 @@ -152,10 +156,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 @@ -805,7 +805,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 bc092ae

Please sign in to comment.