Skip to content

Instantly share code, notes, and snippets.

@MonsieurMan
Last active August 10, 2018 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MonsieurMan/dedd2070af1247e7f561933c905b8c1d to your computer and use it in GitHub Desktop.
Save MonsieurMan/dedd2070af1247e7f561933c905b8c1d to your computer and use it in GitHub Desktop.
Unit testing Stencil component
import { TestWindow } from '@stencil/core/testing';
import { Adder } from './adder';
describe('adder', () => {
it('should build', () => {
expect(new Adder()).toBeTruthy();
});
describe('rendering', () => {
let element: HTMLAdderElement;
let testWindow: TestWindow;
beforeEach(async () => {
testWindow = new TestWindow();
element = await testWindow.load({
components: [Adder],
html: '<adder></adder>'
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment