diff --git a/tests/__mocks__/react.js b/tests/__mocks__/react.js new file mode 100644 index 0000000000..072da8061c --- /dev/null +++ b/tests/__mocks__/react.js @@ -0,0 +1,11 @@ +const React = require.requireActual('react'); + +if (!React.createContext) { + React.createContext = () => { + const Provider = ({ children }) => children; + const Consumer = ({ children }) => children(); + return { Provider, Consumer }; + }; +} + +module.exports = React;