@samitouri / QOS-React / commits / b9f65d9b1d

Fix reactComponentExpect.toBeDOMComponentWithChildCount(0) regression (#8271)

This should fix https://github.com/facebook/react/commit/3e2680411efa3b478afc1f26057f417c7aae7915#commitcomment-19788988.

Dan Abramov committed Nov 11, 2016 at 17:26 UTC b9f65d9b1dcb751bb38f8deec6340a5b5d295d28
1 file changed +2 -2
src/test/reactComponentExpect.js
+2 -2
@@ -157,8 +157,8 @@ Object.assign(reactComponentExpectInternal.prototype, {
157 if (count > 0) {
158 expect(renderedChildren).toBeTruthy();
159 expect(Object.keys(renderedChildren).length).toBe(count);
160 - } else {
161 - expect(renderedChildren).toBeFalsy();
160 + } else if (renderedChildren) {
161 + expect(Object.keys(renderedChildren).length).toBe(0);
162 }
163 }
164 return this;