See the issue and the test case with original fix in https://github.com/facebook/react/pull/14802.

We'll need to fix it properly, see https://github.com/facebook/react/pull/14802#issuecomment-463277621.
const shallowRenderer = createRenderer();
    const result = shallowRenderer.render(<SomeMemoComponent ref={testRef} />);
    expect(result.type).toBe('div');
    expect(result.props.children).toEqual([
      <span className="child1" />,
      <span className="child2" />,
    ]);
  });
  it('should warn for forwardRef(memo())', () => {
    const testRef = React.createRef();
    const SomeMemoComponent = React.memo(({foo}) => {
      return <div>{foo}</div>;
    });
    const shallowRenderer = createRenderer();
    expect(() => {
      expect(() => {
        const SomeComponent = React.forwardRef(SomeMemoComponent);
        shallowRenderer.render(<SomeComponent ref={testRef} />);
      }).toWarnDev(
        'Warning: forwardRef requires a render function but received ' +
          'a `memo` component. Instead of forwardRef(memo(...)), use ' +
          'memo(forwardRef(...))',
        {withoutStack: true},
      );
    }).toThrowError(
      'forwardRef requires a render function but was given object.',
    );
  });
});