From 14a2f949436df647d7a7241a370db47867ccd81a Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 7 Jan 2024 14:28:28 -0500 Subject: [PATCH] feat: export components --- src/index.test.mjs | 12 +++++++++--- src/index.test.ts | 6 +++--- src/index.ts | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/index.test.mjs b/src/index.test.mjs index b4d2a7a7..20dc10b9 100644 --- a/src/index.test.mjs +++ b/src/index.test.mjs @@ -4,12 +4,18 @@ import { it } from 'node:test'; import assert from 'assert'; -import { createElement, jsx } from '../cjs/index.js'; +import { createElement, Image, jsx, Video } from '../cjs/index.js'; -it('exports createElement', () => { - assert.strictEqual(typeof createElement, 'function'); +[createElement, Image, Video].forEach((func) => { + it(`exports ${func.name}`, () => { + assert.strictEqual(typeof func, 'function'); + }); }); it('exports jsx', () => { assert.strictEqual(jsx, createElement); }); + +it('exports Image', () => { + assert.strictEqual(typeof Image, 'function'); +}); diff --git a/src/index.test.ts b/src/index.test.ts index 94be51ea..e3ef360e 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,7 +1,7 @@ -import { createElement, jsx } from '.'; +import { Container, createElement, jsx, Rectangle, Text } from '.'; -it('exports createElement', () => { - expect(createElement).toBeInstanceOf(Function); +it.each([Container, Rectangle, Text, createElement])('exports %p', (func) => { + expect(func).toBeInstanceOf(Function); }); it('exports jsx', () => { diff --git a/src/index.ts b/src/index.ts index 931cf89e..47496ca4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,2 @@ +export * from './components'; export { createElement, jsx } from './element';