import * as assert from 'power-assert' import { x } from '../src/x' describe('x function', () => { test('response is object', () => { assert(typeof x("div", {}, []) == 'object') assert(typeof (
) == 'object') }) test('skip if it null or Boolean in children', () => { assert(x("div", {}, [true]).children.length === 0) assert(x("div", {}, [false]).children.length === 0) assert(x("div", {}, [null]).children.length === 0) assert((
{true}
).children.length === 0) assert((
{false}
).children.length === 0) assert((
{null}
).children.length === 0) }) test("JSX component syntax", () => { const Component = (attrs, children) =>
{children}
assert.deepEqual((foo), { props: { key: "key" }, children: [ { props: { xa: { text: "foo" } }, children: [], key: undefined, name: "xa-txt", } ], key: "key", name: Component, }) }) })