We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pros
Cons
Example of testing basic rendering
it('renders basic string', () => { const native = container => { const div = document.createElement('div'); Object.assign(div, { id: 'target', textContent: 'No interpolation.' }); container.replaceChildren(); container.append(div); }; const engine = container => { const result = html`<div id="target">No interpolation.</div>`; render(container, result); }; const nativeContainer = document.createElement('div'); const engineContainer = document.createElement('div'); document.body.append(nativeContainer, engineContainer); native(nativeContainer); engine(engineContainer); assert( nativeContainer.childNodes.length === engineContainer.childNodes.length ); assert( nativeContainer.querySelector('#target').textContent === engineContainer.querySelector('#target').textContent ); nativeContainer.remove(); engineContainer.remove(); });
… currently, this test reads as follows …
it('renders basic string', () => { const getTemplate = () => { return html`<div id="target">No interpolation.</div>`; }; const container = document.createElement('div'); document.body.append(container); render(container, getTemplate()); assert(container.childNodes.length === 1); assert(container.querySelector('#target').textContent === 'No interpolation.'); container.remove(); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Pros
Cons
Example of testing basic rendering
… currently, this test reads as follows …
The text was updated successfully, but these errors were encountered: