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 Sep 5, 2023
1 parent 6bebeab commit f20421f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
Expand Down
11 changes: 6 additions & 5 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
/**
* @typedef {import('../index.js').Options} Options
* @typedef {import('rehype-autolink-headings').Options} Options
*/

import assert from 'node:assert/strict'
import fs from 'node:fs/promises'
import test from 'node:test'
import {isHidden} from 'is-hidden'
import {rehype} from 'rehype'
import rehypeAutolinkHeadings from '../index.js'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'

test('rehypeAutolinkHeadings', async function (t) {
await t.test('should expose the public api', async function () {
assert.deepEqual(Object.keys(await import('../index.js')).sort(), [
'default'
])
assert.deepEqual(
Object.keys(await import('rehype-autolink-headings')).sort(),
['default']
)
})

await t.test('should support functions', async function () {
Expand Down

0 comments on commit f20421f

Please sign in to comment.