Skip to content

Lupa API Reference / @pawel-up/lupa/testing / html

Variable: html

const html: (strings, ...values) => TemplateResult<1> = litHtml

Defined in: src/testing/api.ts:217

html template tag from lit-html. Used for creating DOM templates to be rendered by fixture.

Interprets a template literal as an HTML template that can efficiently render to and update a container.

ts
const header = (title: string) => html`<h1>${title}</h1>`;

The html tag returns a description of the DOM to render as a value. It is lazy, meaning no work is done until the template is rendered. When rendering, if a template comes from the same expression as a previously rendered result, it's efficiently updated instead of replaced.

Parameters

strings

TemplateStringsArray

values

...unknown[]

Returns

TemplateResult<1>