reactComponentExpect fails silently
```reactComponentExpect``` fails silently when passed an undefined value. It calls ```ReactTestUtils.isCompositeComponent``` with the undefined value, in which a ```render``` property is accessed, throwing a prop on undefined not found error which isn't surfaced to jest. ``` TypeError: Cannot read property 'render' of undefined at Object.ReactTestUtils.isCompositeComponent (./react/test/ReactTestUtils.js:127:23) at new reactComponentExpect (./react/test/reactComponentExpect.js:46:20) at reactComponentExpect (./react/test/reactComponentExpect.js:40:12) ``` Expecting the passed-in instance to not be undefined surfaces this issue in the test runner.
J. Renée Beach committed
Aug 7, 2015 at 11:21 UTC
39c3fb2b097c4d2d7b7bb9b5b1a33b88c180fd8f
1 file changed
+1
src/test/reactComponentExpect.js
+1
@@ -28,6 +28,7 @@ function reactComponentExpect(instance) {
28
}
29
30
expect(instance).not.toBeNull();
31
+ expect(instance).not.toBeUndefined();
32
33
invariant(
34
ReactTestUtils.isCompositeComponent(instance),