From f4cfa2b9c0a7a1326b6b9b11f86ef5118c3a622a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 16 Jan 2019 22:53:59 +0300 Subject: add jest workaround: https://github.com/airbnb/enzyme/issues/1875 --- vnext/src/components/__tests__/MessageInput-test.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'vnext') diff --git a/vnext/src/components/__tests__/MessageInput-test.js b/vnext/src/components/__tests__/MessageInput-test.js index 1cf89ebf..c26d622c 100644 --- a/vnext/src/components/__tests__/MessageInput-test.js +++ b/vnext/src/components/__tests__/MessageInput-test.js @@ -5,6 +5,12 @@ import Adapter from 'enzyme-adapter-react-16'; import MessageInput from '../MessageInput'; +// Remove when it will be fixed: https://github.com/airbnb/enzyme/issues/1875 +jest.mock('react', () => { + const r = jest.requireActual('react'); + return { ...r, memo: (x) => x }; +}); + configure({ adapter: new Adapter() }); const testMessage = { @@ -16,9 +22,9 @@ const testMessage = { window.matchMedia = window.matchMedia || function() { return { - matches : false, - addListener : function() {}, - removeListener: function() {} + matches: false, + addListener: function() { }, + removeListener: function() { } }; }; -- cgit v1.2.3