Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 19, 2023
1 parent 086e1a5 commit 64aeb0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @typedef {import('hast').Root} HastRoot
* @typedef {import('hast-util-to-mdast').Options} Options
* @typedef {import('mdast').Root} MdastRoot
* @typedef {import('unified').Processor<MdastRoot>} Processor
* @typedef {import('unified').Processor} Processor
* @typedef {import('vfile').VFile} VFile
*/

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"rehype-stringify": "^10.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"remark-stringify": "^10.0.0",
"remark-stringify": "^11.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.56.0"
Expand All @@ -58,7 +58,7 @@
"prepack": "npm run build && npm run format",
"test": "npm run build && npm run format && npm run test-coverage",
"test-api": "node --conditions development test.js",
"test-coverage": "c8 --100 --check-coverage --reporter lcov npm run test-api"
"test-coverage": "c8 --100 --reporter lcov npm run test-api"
},
"prettier": {
"bracketSpacing": false,
Expand Down
15 changes: 2 additions & 13 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,17 @@ test('rehypeRemark', async function (t) {
const file = await unified()
.use(rehypeParse)
.use(rehypeRemark)
// @ts-expect-error: to do: remove when `remark` is released.
.use(remarkStringify)
.process('<h2>Hello, world!</h2>')

assert.equal(String(file), '## Hello, world!\n')
})

await t.test('should bridge', async function () {
// @ts-expect-error: to do: remove when `remark` is released.
const destination = unified().use(remarkStringify)

const file = await unified()
.use(rehypeParse, {fragment: true})
// @ts-expect-error: to do: remove when `remark` is released.
.use(rehypeRemark, destination)
// @ts-expect-error: TS currently barfs on overloads that result in mutate/bridges.
.use(rehypeRemark, unified())
.use(rehypeStringify)
.process('<h2>Hello, world!</h2>')

Expand All @@ -46,22 +42,16 @@ test('rehypeRemark', async function (t) {
const file = await unified()
.use(rehypeParse, {fragment: true})
.use(rehypeRemark, {document: false})
// @ts-expect-error: to do: remove when `remark` is released.
.use(remarkStringify)
.process('<i>Hello</i>, <b>world</b>!')

// This one looks buggy, but that’s ’cause `remark-stringify` always expects
// a complete document.
// The fact that it bugs-out thus shows that the phrasing are handled
// normally.
assert.equal(String(file), '*Hello*, **world**!\n')
})

await t.test('should default to `document: true`', async function () {
const file = await unified()
.use(rehypeParse, {fragment: true})
.use(rehypeRemark)
// @ts-expect-error: to do: remove when `remark` is released.
.use(remarkStringify)
.processSync('<i>Hello</i>, <b>world</b>!')

Expand All @@ -87,7 +77,6 @@ test('rehypeRemark', async function (t) {
}
}
})
// @ts-expect-error: to do: remove when `remark` is released.
.use(remarkStringify)
.process('<div>example</div>')

Expand Down

0 comments on commit 64aeb0d

Please sign in to comment.