Skip to content

Commit 4e2fb88

Browse files
committed
Do not expose getRootNodeInternal
1 parent a3fc7bb commit 4e2fb88

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/enzyme-test-suite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@
4949
"eslint-plugin-jsx-a11y": "^6.0.3",
5050
"eslint-plugin-react": "^7.6.1"
5151
}
52-
}
52+
}

packages/enzyme/src/ShallowWrapper.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ function getRootNode(node) {
9797
return node.rendered;
9898
}
9999

100+
function getRootNodeInternal(wrapper) {
101+
return wrapper[ROOT][NODE];
102+
}
103+
100104
function privateSetNodes(wrapper, nodes) {
101105
if (!Array.isArray(nodes)) {
102106
privateSet(wrapper, NODE, nodes);
@@ -150,10 +154,6 @@ class ShallowWrapper {
150154
return this[ROOT];
151155
}
152156

153-
getRootNodeInternal() {
154-
return this[ROOT][NODE];
155-
}
156-
157157
getNodeInternal() {
158158
if (this.length !== 1) {
159159
throw new Error('ShallowWrapper::getNode() can only be called when wrapping one node');
@@ -803,7 +803,7 @@ class ShallowWrapper {
803803
* @returns {ShallowWrapper}
804804
*/
805805
parents(selector) {
806-
const allParents = this.wrap(this.single('parents', n => parentsOfNode(n, this.getRootNodeInternal())));
806+
const allParents = this.wrap(this.single('parents', n => parentsOfNode(n, getRootNodeInternal(this))));
807807
return selector ? allParents.filter(selector) : allParents;
808808
}
809809

0 commit comments

Comments
 (0)