(markup)
| 6 | * Note that rendering twice within the same test method will update the same element (rather than recreate it). |
| 7 | */ |
| 8 | export function render(markup) { |
| 9 | if (!render._mountNode) { |
| 10 | render._mountNode = document.createElement('div'); |
| 11 | |
| 12 | // Unless we attach the mount-node to body, getBoundingClientRect() won't work |
| 13 | document.body.appendChild(render._mountNode); |
| 14 | |
| 15 | afterEach(render.unmount); |
| 16 | } |
| 17 | |
| 18 | return ReactDOM.render(markup, render._mountNode); |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * The render() method auto-unmounts components after each test has completed. |
no test coverage detected
searching dependent graphs…