1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
3 | import { render as enzymeRender } from 'enzyme';
|
4 | import * as React from 'react';
|
5 | import { RenderContext } from './RenderMode';
|
6 | let warnedOnce = false;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | export default function createRender(options1 = {}) {
|
13 | if (!warnedOnce) {
|
14 | warnedOnce = true;
|
15 | console.warn(['Material-UI: the test utils are deprecated, they are no longer present in v5.', 'The helpers were designed to work with enzyme.', 'However, the tests of the core components were moved to react-testing-library.'].join('\n'));
|
16 | }
|
17 |
|
18 | const {
|
19 | render = enzymeRender
|
20 | } = options1,
|
21 | other1 = _objectWithoutPropertiesLoose(options1, ["render"]);
|
22 |
|
23 | const renderWithContext = function renderWithContext(node, options2 = {}) {
|
24 | return render( React.createElement(RenderContext, null, node), _extends({}, other1, options2));
|
25 | };
|
26 |
|
27 | return renderWithContext;
|
28 | } |
\ | No newline at end of file |