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.
static contextTypes = {
        name: PropTypes.string,
      };
      render() {
        return <div>{this.context.name}</div>;
      }
    }
    const shallowRenderer = createRenderer();
    const result = shallowRenderer.render(<SimpleComponent />, {
      name: 'foo',
    });
    expect(result).toEqual(<div>foo</div>);
  });
  it('should track context across updates', () => {
    class SimpleComponent extends React.Component {