Skip to content

Commit

Permalink
Change to use exports
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 5, 2023
1 parent bfce642 commit a227695
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
Expand Down
9 changes: 5 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@
import assert from 'node:assert/strict'
import fs from 'node:fs/promises'
import test from 'node:test'
import {fromParse5} from 'hast-util-from-parse5'
import {isHidden} from 'is-hidden'
import {parse, parseFragment} from 'parse5'
import {read, toVFile} from 'to-vfile'
import {visit} from 'unist-util-visit'
import {fromParse5} from '../index.js'

test('fromParse5', async function (t) {
const file = toVFile({value: '<title>Hello!</title><h1>World!'})

await t.test('should expose the public api', async function () {
assert.deepEqual(Object.keys(await import('../index.js')).sort(), [
'fromParse5'
])
assert.deepEqual(
Object.keys(await import('hast-util-from-parse5')).sort(),
['fromParse5']
)
})

await t.test('should transform a complete document', async function () {
Expand Down

0 comments on commit a227695

Please sign in to comment.