Skip to content

Commit 0bcd5ce

Browse files
committed
Add tests for exposed identifiers
1 parent b886ed2 commit 0bcd5ce

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

test/core.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {x} from '../index.js'
3+
import {x} from 'xastscript'
4+
import * as coreMod from 'xastscript'
5+
import * as jsxCoreMod from 'xastscript/jsx-runtime'
6+
import * as jsxDevMod from 'xastscript/jsx-dev-runtime'
47

58
test('xastscript', () => {
6-
assert.equal(typeof x, 'function', 'should expose a function')
9+
assert.deepEqual(
10+
Object.keys(coreMod).sort(),
11+
['x'],
12+
'should expose the public api (`/`)'
13+
)
14+
assert.deepEqual(
15+
Object.keys(jsxCoreMod).sort(),
16+
['Fragment', 'jsx', 'jsxs'],
17+
'should expose the public api (`/jsx-runtime`)'
18+
)
19+
assert.deepEqual(
20+
Object.keys(jsxDevMod).sort(),
21+
['Fragment', 'jsxDEV'],
22+
'should expose the public api (`/jsx-dev-runtime`)'
23+
)
724

825
assert.deepEqual(
926
x(),

test/jsx.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import assert from 'node:assert/strict'
44
import test from 'node:test'
55
import {u} from 'unist-builder'
6-
import {x} from '../index.js'
6+
import {x} from 'xastscript'
77

88
test('name', () => {
99
assert.deepEqual(<a />, x('a'), 'should support a self-closing element')

0 commit comments

Comments
 (0)