brf/client/test/utils.ts
2025-11-23 21:44:01 +01:00

18 lines
338 B
TypeScript

export function render(str: string, container?: HTMLElement) {
if (!container) {
container ||= document.createElement('div')
document.body.appendChild(container)
}
container.innerHTML = str
return container
}
export function cleanup() {
while (document.body.firstChild) {
document.body.firstChild.remove()
}
}