diff --git a/lib/component.js b/lib/component.js index 5d69643..4363c10 100644 --- a/lib/component.js +++ b/lib/component.js @@ -55,6 +55,10 @@ function makeComponent(Container) { } const proto = new Proxy(BaseElement.prototype, { + getPrototypeOf(target) { + return target; + }, + set(target, key, value, receiver) { if(key in target) { Reflect.set(target, key, value); diff --git a/test/test-export.js b/test/test-export.js index ef5d139..a271961 100644 --- a/test/test-export.js +++ b/test/test-export.js @@ -1,7 +1,7 @@ import { component, html } from '../haunted.js'; import { attach, cycle } from './helpers.js'; -describe('Component exports', () => { +describe('component()', () => { it('works', async () => { customElements.define('exports-test', component(() => { return html`Test`; @@ -13,4 +13,14 @@ describe('Component exports', () => { assert.equal(host.firstChild.shadowRoot.firstChild.nextSibling.nodeValue, 'Test', 'Rendered'); teardown(); }); + + it('Is an instance of HTMLElement', () => { + const tag = 'component-instanceof'; + customElements.define(tag, component(() => { + return html`Test`; + })); + + const el = document.createElement(tag); + assert.ok(el instanceof HTMLElement, 'Is an HTMLElement'); + }); });