Merge pull request #5199 from jimfb/number-found

Print number of matches (previously unclear if zero or multiple)
This commit is contained in:
Jim
2015-10-16 13:00:49 -07:00
+3 -1
View File
@@ -237,7 +237,9 @@ var ReactTestUtils = {
findRenderedDOMComponentWithTag: function(root, tagName) {
var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
if (all.length !== 1) {
throw new Error('Did not find exactly one match for tag:' + tagName);
throw new Error('Did not find exactly one match ' +
'(found ' + all.length + ') for tag:' + tagName
);
}
return all[0];
},