Same as https://github.com/facebook/react/issues/10103, but for the server renderer. You can look at implementation in https://github.com/facebook/react/pull/11168 and do something very similar in `ReactPartialRenderer.js`.
lifecycle.push('componentWillUpdate');
          }
          componentDidUpdate() {
            lifecycle.push('componentDidUpdate');
          }
          shouldComponentUpdate() {
            lifecycle.push('shouldComponentUpdate');
          }
          componentWillReceiveProps() {
            lifecycle.push('componentWillReceiveProps');
          }
          componentWillUnmount() {
            lifecycle.push('componentWillUnmount');
          }
        }
        const response = ReactDOMServer.renderToString(<TestComponent />);
        expect(response).toMatch(
          new RegExp(
            '<span ' +
              'data-reactroot' +
              '=""' +
              '>' +
              'Component name: <!-- -->TestComponent' +
              '</span>',
          ),
        );
        expect(lifecycle).toEqual([
          'getInitialState',
          'componentWillMount',