mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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.
This commit is contained in:
committed by
Paul O’Shannessy
parent
976826aec0
commit
fe9cecd507
@@ -74,6 +74,10 @@ var ReactTestUtils = {
|
||||
if (!ReactComponent.isValidComponent(inst)) {
|
||||
return false;
|
||||
}
|
||||
if (inst.__realComponentInstance) {
|
||||
// This is a descriptor membrane
|
||||
return false;
|
||||
}
|
||||
// We check the prototype of the type that will get mounted, not the
|
||||
// instance itself. This is a future proof way of duck typing.
|
||||
var prototype = inst.type.prototype;
|
||||
|
||||
Reference in New Issue
Block a user