/* @jsx h */ import {createRef, Fragment, h, render} from '../src/hiroshi'; declare module '../src/hiroshi' { namespace h.JSX { interface IntrinsicElements { 'custom-element': h.JSX.HTMLElementAttribute & { bool: boolean } } } } test('simply create tag', () => { const node = render(
simply-create-tag
); const expected = ''; expect((node as HTMLElement).outerHTML).toEqual(expected); }); test('support fragment', () => { render(
Child 1
Child 2
, document.body); expect(document.querySelectorAll('div').length).toEqual(2); }); test('support createRefObject', () => { const ref = createRef(); render(
); expect(ref.current?.nodeName).toEqual('BR'); }); test('support functional ref', () => { render(
expect(node.nodeName).toEqual('BR')}/>); }); test('boolean attribute', () => { const node = render(); expect((node as HTMLElement).outerHTML).toEqual(''); }) test('svg', () => { const node = render(); expect((node as Element).outerHTML).toEqual(''); }); test('custom element', () => { const node = render(TEST); expect((node as Element).outerHTML).toEqual('TEST'); })