Skip to content

Instantly share code, notes, and snippets.

@Tallyb
Created June 7, 2019 13:28
Show Gist options
  • Save Tallyb/1169b8cb0938d5e95365755470c54f99 to your computer and use it in GitHub Desktop.
Save Tallyb/1169b8cb0938d5e95365755470c54f99 to your computer and use it in GitHub Desktop.
Basic component test
import { newSpecPage } from "@stencil/core/dist/testing";
import { MyBasic } from './basic';
describe('basic', () => {
it('should render', async () => {
const page = await newSpecPage({
html: `<my-basic first="Julia" last="Roberts"></my-basic>`,
components: [MyBasic]
});
expect(page.root).toEqualHtml(`
<my-basic first=\"Julia\" last=\"Roberts\">
<mock:shadow-root>
<p>
My name is Roberts Julia
</p>
</mock:shadow-root>
</my-basic>
`);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment