diff --git a/tests/js/sentry-test/enzyme.js b/tests/js/sentry-test/enzyme.js index 04ed17abe0f1cb..673bd34c64d16d 100644 --- a/tests/js/sentry-test/enzyme.js +++ b/tests/js/sentry-test/enzyme.js @@ -1,9 +1,14 @@ import {cache} from '@emotion/css'; // eslint-disable-line emotion/no-vanilla import {CacheProvider, ThemeProvider} from '@emotion/react'; -import {mount, render, shallow} from 'enzyme'; // eslint-disable-line no-restricted-imports +import {mount, shallow as enzymeShallow} from 'enzyme'; // eslint-disable-line no-restricted-imports import {lightTheme} from 'app/utils/theme'; +/** + * @deprecated + * As we are migrating our tests to React Testing Library, + * please avoid using `sentry-test/enzyme/mountWithTheme` and use `sentry-test/reactTestingLibrary/mountWithTheme` instead. + */ const mountWithTheme = (tree, opts) => { const WrappingThemeProvider = props => ( @@ -14,4 +19,11 @@ const mountWithTheme = (tree, opts) => { return mount(tree, {wrappingComponent: WrappingThemeProvider, ...opts}); }; -export {mountWithTheme, render, shallow}; +/** + * @deprecated + * As we are migrating our tests to React Testing Library, + * please avoid using `sentry-test/enzyme/shallow` and use `sentry-test/reactTestingLibrary/mountWithTheme` instead. + */ +const shallow = enzymeShallow; + +export {mountWithTheme, shallow};