Skip to content

Commit fe9cecd

Browse files
committed
Clean up assertions on descriptors
By making this fail, we catch a lot of tests that are expecting rendered instances but are actually operating on descriptors.
1 parent 976826a commit fe9cecd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/test/ReactTestUtils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ var ReactTestUtils = {
7474
if (!ReactComponent.isValidComponent(inst)) {
7575
return false;
7676
}
77+
if (inst.__realComponentInstance) {
78+
// This is a descriptor membrane
79+
return false;
80+
}
7781
// We check the prototype of the type that will get mounted, not the
7882
// instance itself. This is a future proof way of duck typing.
7983
var prototype = inst.type.prototype;

0 commit comments

Comments
 (0)