Im using findRenderedComponentWithType to make sure there is a error, and Im using chai's assert.throws, but it is not working.
first of all:
TestUtils.findRenderedComponentWithType documentation:
expects there to be one result and returns that one result, or throws exception if there is any other number of matches besides one.
When I use the function, Im getting an error (as expected and correct).
However I cant seems to assert it properly with chai:
I tried assert.throws(TestUtils.findRenderedComponentWithType(element, component), /(Error)/)
. But it is saying the test failed, even though I'm getting an error:
Error: Did not find exactly one match for componentType:function (props, context, updater) {
[...]
}