1.0.0 • Published 2 years ago

@domx/testutils v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

TestUtils · GitHub license Build Status Lines npm

Common testing utility scripts.

Installation

npm install @domx/testutils

fragment

The test fragment can be used to test HTML elements that need to be appended to the DOM.

@import {fixture, html} from  "@domx/testutils";

const el = fixture(html`<my-element></my-element>`);
el.restore();

The html literal is from lit-html which provides for other usage patterns:

@import {fixture, html} from  "@domx/testutils";

const userDetailsEl= userId => html<user-details user-id="${userId}"></user-details>; const el = fixture(userDetailsEl(123)); el.restore();

> The `fixture` supports typing
```js
const el= fixture<UserDetails>(html`<user-details></user-details>`);
console.log(el.userId);
el.restore();
1.0.0

2 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago