From fc2fef066c7b870b64fdc0d7a91aac84201abdda Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Thu, 22 Dec 2016 14:17:25 +0000 Subject: [PATCH] Test error messages for getDOMNode --- test/ReactWrapper-spec.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/ReactWrapper-spec.jsx b/test/ReactWrapper-spec.jsx index 29adfb0c8..6723551cd 100644 --- a/test/ReactWrapper-spec.jsx +++ b/test/ReactWrapper-spec.jsx @@ -3399,7 +3399,10 @@ describeWithDOM('mount', () => { it('should throw when wrapping multiple elements', () => { const wrapper = mount().find('span'); - expect(() => wrapper.getDOMNode()).to.throw(Error); + expect(() => wrapper.getDOMNode()).to.throw( + Error, + 'Method “getDOMNode” is only meant to be run on a single node. 2 found instead.', + ); }); describeIf(!REACT013, 'stateless components', () => { @@ -3424,7 +3427,10 @@ describeWithDOM('mount', () => { it('should throw when wrapping multiple elements', () => { const wrapper = mount().find('span'); - expect(() => wrapper.getDOMNode()).to.throw(Error); + expect(() => wrapper.getDOMNode()).to.throw( + Error, + 'Method “getDOMNode” is only meant to be run on a single node. 2 found instead.', + ); }); }); });