From e0904a0a90a4dee14c4ff472f15f34e0c8746446 Mon Sep 17 00:00:00 2001 From: Jim Date: Fri, 16 Oct 2015 12:43:09 -0700 Subject: [PATCH] Print number of matches (previously unclear if zero or multiple) --- src/test/ReactTestUtils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/ReactTestUtils.js b/src/test/ReactTestUtils.js index 8151a90a70..8ee27c7b5e 100644 --- a/src/test/ReactTestUtils.js +++ b/src/test/ReactTestUtils.js @@ -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]; },