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.
Paul O'Shannessy committed
Mar 27, 2014 at 13:17 UTC
fe9cecd50710c5be079072ad29a258b5cae45df3
1 file changed
+4
src/test/ReactTestUtils.js
+4
@@ -74,6 +74,10 @@ var ReactTestUtils = {
74
if (!ReactComponent.isValidComponent(inst)) {
75
return false;
76
}
77
+ if (inst.__realComponentInstance) {
78
+ // This is a descriptor membrane
79
+ return false;
80
+ }
81
// We check the prototype of the type that will get mounted, not the
82
// instance itself. This is a future proof way of duck typing.
83
var prototype = inst.type.prototype;