1+ import assert from 'node:assert/strict'
12import fs from 'node:fs'
23import path from 'node:path'
34import test from 'tape'
4- import Slugger from 'github-slugger'
5+ import { slug } from 'github-slugger'
56import { toHast } from 'mdast-util-to-hast'
67import { toHtml } from 'hast-util-to-html'
78import { fromMarkdown } from 'mdast-util-from-markdown'
@@ -18,7 +19,7 @@ test('markdown -> mdast', (t) => {
1819
1920 while ( ++ index < files . length ) {
2021 const example = files [ index ]
21- const category = Slugger . slug ( example . category )
22+ const category = slug ( example . category )
2223 const name = index + '-' + category
2324 const fixtureHtmlPath = path . join ( 'test' , name + '.html' )
2425 const fixtureMarkdownPath = path . join ( 'test' , name + '.md' )
@@ -28,14 +29,14 @@ test('markdown -> mdast', (t) => {
2829 mdastExtensions : [ gfmFromMarkdown ( ) ]
2930 } )
3031
31- const html = toHtml (
32- toHast ( mdast , { allowDangerousHtml : true , commonmark : true } ) ,
33- {
34- allowDangerousHtml : true ,
35- entities : { useNamedReferences : true } ,
36- closeSelfClosing : true
37- }
38- )
32+ const hast = toHast ( mdast , { allowDangerousHtml : true , commonmark : true } )
33+ assert ( hast , 'expected node' )
34+
35+ const html = toHtml ( hast , {
36+ allowDangerousHtml : true ,
37+ entities : { useNamedReferences : true } ,
38+ closeSelfClosing : true
39+ } )
3940
4041 let fixtureHtml
4142 let fixtureMarkdown
0 commit comments