function helpTestSplit(
    offset, firstHalfString, secondHalfString, isAppend, goToBody = undefined) {
  const node = dom.createElement(TagName.DIV);
  node.innerHTML = '<b>begin bold<i>italic</i>end bold</b>';
  document.body.appendChild(node);

  const italic = dom.getElementsByTagName(TagName.I, node)[0].firstChild;

  /** @suppress {visibility} suppression added to enable type checking */
  const splitFn = isAppend ? TagOnEnterHandler.splitDomAndAppend_ :
                             TagOnEnterHandler.splitDom_;
  /** @suppress {checkTypes} suppression added to enable type checking */
  const secondHalf = splitFn(italic, offset, goToBody ? undefined : node);

  if (goToBody) {
    secondHalfString = `<div>${secondHalfString}</div>`;
  }

  assertEquals(
      'original node should have first half of the html', firstHalfString,
      node.innerHTML.toLowerCase().replace(Unicode.NBSP, '&nbsp;'));
  assertEquals(
      'new node should have second half of the html', secondHalfString,
      secondHalf.innerHTML.toLowerCase().replace(Unicode.NBSP, '&nbsp;'));

  if (isAppend) {
    assertTrue(
        'second half of dom should be the original node\'s next' +
            'sibling',
        node.nextSibling == secondHalf);
    dom.removeNode(secondHalf);
  }

  dom.removeNode(node);
}
Runs a test for splitting the dom.
@param {number} offset Index into the text node to split.
@param {string} firstHalfString What the html of the first half of the DOM
    should be.
@param {string} secondHalfString What the html of the 2nd half of the DOM
    should be.
@param {boolean} isAppend True if the second half should be appended to the
    DOM.
@param {boolean=} opt_goToRoot True if the root argument for splitDom should
    be excluded.
@suppress {checkTypes,strictMissingProperties} suppression added to enable
type checking