From fe9cecd50710c5be079072ad29a258b5cae45df3 Mon Sep 17 00:00:00 2001 From: Paul O'Shannessy Date: Thu, 27 Mar 2014 13:17:39 -0700 Subject: [PATCH] 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. --- src/test/ReactTestUtils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/ReactTestUtils.js b/src/test/ReactTestUtils.js index 8d34272703..4b067f7cee 100644 --- a/src/test/ReactTestUtils.js +++ b/src/test/ReactTestUtils.js @@ -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;