code: function makeShallowOptions(nodes, root, passedOptions, wrapper) {
    const options = makeOptions(passedOptions);
    const adapter = getAdapter(passedOptions);
    privateSet(options, PROVIDER_VALUES, passedOptions[PROVIDER_VALUES]);
    if (root || !isCustomComponent(options.wrappingComponent, adapter)) {
      return options;
    }
    if (typeof adapter.wrapWithWrappingComponent !== 'function') {
      throw new TypeError('your adapter does not support `wrappingComponent`. Try upgrading it!');
    }
    const { node: wrappedNode, RootFinder } = adapter.wrapWithWrappingComponent(nodes, options);
    // eslint-disable-next-line no-use-before-define
    const wrappingComponent = new WrappingComponentWrapper(wrappedNode, wrapper, RootFinder);
    const {
      legacyContext: wrappingComponentLegacyContext,
      providerValues: wrappingComponentProviderValues,
    } = getContextFromWrappingComponent(wrappingComponent, adapter);
    privateSet(wrapper, WRAPPING_COMPONENT, wrappingComponent);
    return {
      ...options,
      context: {
        ...options.context,
        ...wrappingComponentLegacyContext,
      },
      [PROVIDER_VALUES]: wrappingComponentProviderValues,
    };
  }
docs: Makes options specifically for `ShallowWrapper`. Most of the logic here is around rendering
  a `wrappingComponent` (if one was provided) and adding the child context of that component
  to `options.context`.
  
  @param {ReactElement} nodes the nodes passed to `ShallowWrapper`
  @param {ShallowWrapper} root this `ShallowWrapper`'s parent. If this is passed, options are
  not transformed.
  @param {*} passedOptions the options passed to `ShallowWrapper`.
  @param {*} wrapper the `ShallowWrapper` itself
  @returns {Object} the decorated and transformed options