Ref: https://github.com/facebook/react/issues/631#issuecomment-214909216

It's a little surprising that the codepath is even being hit, maybe that's a bug too, but there should clearly be some sort of `if` check in that area.

return (str + '').replace(/([.?*+\^$\[\]\\(){}|-])/g, '\\$1');
    }
    beforeEach(function() {
      var ReactDOMComponent = require('ReactDOMComponent');
      var ReactReconcileTransaction = require('ReactReconcileTransaction');
      var NodeStub = function(initialProps) {
        this._currentElement = {props: initialProps};
        this._rootNodeID = 'test';
      };
      Object.assign(NodeStub.prototype, ReactDOMComponent.Mixin);
      genMarkup = function(props) {
        var transaction = new ReactReconcileTransaction();
        return (new NodeStub(props))._createContentMarkup(
          transaction,
          props,
          {}
        );
      };
      this.addMatchers({
        toHaveInnerhtml: function(html) {
          var expected = '^' + quoteRegexp(html) + '$';
          return this.actual.match(new RegExp(expected));
        },
      });
    });