function render (markup) {
  if (!render._root) {
    const div = document.createElement('div')
    document.body.appendChild(div)
    const root = createRoot(div)
    render._root = root
    render._mountNode = div

    afterEach(render.unmount)
  }

  render._root.render(markup)
}
Helper method for testing components that may use Portal and thus require cleanup.
This helper method renders components to a transient node that is destroyed after the test completes.
Note that rendering twice within the same test method will update the same element (rather than recreate it).