Lupa API Reference / testing/fixture / TemplateTypes
Type Alias: TemplateTypes
TemplateTypes =
string|ReturnType<typeoflitHtml> |TemplateResult
Defined in: src/testing/fixture.ts:20
Type alias for a template that can be rendered by the fixture function.
Example
ts
test('renders lit template', async ({ assert }) => {
const el = await fixture<HTMLButtonElement>(html`<button>Click me</button>`)
assert.equal(el.textContent, 'Click me')
})
test('renders string template', async ({ assert }) => {
const el = await fixture<HTMLDivElement>('<div id="test"></div>')
assert.equal(el.id, 'test')
})