Skip to content

Commit

Permalink
Clean up assertions on descriptors
Browse files Browse the repository at this point in the history
By making this fail, we catch a lot of tests that are expecting rendered
instances but are actually operating on descriptors.
  • Loading branch information
zpao committed Mar 27, 2014
1 parent 976826a commit fe9cecd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/ReactTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fe9cecd

Please sign in to comment.