const {DOMParser} = require('linkedom'); const document = (new DOMParser).parseFromString('
', 'text/html'); globalThis.document = document; const {render, html, svg} = require('../cjs'); const {Event} = document.defaultView; const {body} = document; const fragment = () => html`1
2
`; const variousContent = content => html`${content}`; render(body, html`this is a test`); render(body, html`this is a ${ [1, 2].map(n => html`${n}`) } test`); render(body, html`this is a ${ [1, 2].map(n => svg`${n}`) } test`); (function twice(i) { render(body, html`this is a ${ (i ? [1, 2, 3] : [1, 2]).map(n => svg`${n}`) } test`); if (i--) twice(i); }(1)); render(body, html`this is a ${'test'}`); render(body, html`this is a ${true}`); render(body, html`this is a ${1} ${2} ${3}`); render(body, html`this is a ${1}`); let div = document.createElement('div'); render(div, html.node`this is a test`); render(div, html.for(body)`this is a test`); render(div, html.for(body, 1)`this is a test`); render(div, () => html.for(body)`this is a test`); render(div, () => html.for(body, 1)`this is a test`); (function twice(i) { render(div, () => html.for(body)`this is a test`); render(div, () => html.for(body, 1)`this is a test`); if (i--) twice(i); }(1)); let clicked = false; render(div, html`${'hole'}
`); render(body, html`