Skip to content

Commit

Permalink
feat: export components
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Jan 7, 2024
1 parent b5cd977 commit 14a2f94
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
12 changes: 9 additions & 3 deletions src/index.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
6 changes: 3 additions & 3 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './components';
export { createElement, jsx } from './element';

0 comments on commit 14a2f94

Please sign in to comment.