// @flow weak

import { create } from 'jss';
import jssPreset from 'jss-preset-default';
import { createStyleManager } from 'jss-theme-reactor';
import { shallow as enzymeShallow } from 'enzyme';
import { createMuiTheme } from '../styles/theme';

export default function createShallow(
  shallow = enzymeShallow,
  otherContext = {},
) {
  const theme = createMuiTheme();
  const jss = create(jssPreset());
  const styleManager = createStyleManager({ jss, theme });
  const context = { theme, styleManager, ...otherContext };
  const shallowWithContext = function shallowWithContext(node, options = {}) {
    return shallow(node, {
      context: {
        ...context,
        ...options.context,
      },
    });
  };

  shallowWithContext.context = context;

  shallowWithContext.cleanUp = () => {
    styleManager.reset();
  };

  return shallowWithContext;
}

@@ -758,79 +758,8 @@
 t;%0A%0A
-  shallowWithContext.cleanUp = () =%3E %7B%0A    styleManager.reset();%0A  %7D;%0A%0A
   re

Remove cleanUp() from createShallow as it is not used in the entire project (#6797)