mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #5199 from jimfb/number-found
Print number of matches (previously unclear if zero or multiple)
This commit is contained in:
@@ -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];
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user