@@ -68,11 +68,11 @@ test('remarkRehype', async function (t) {
6868 await t . test (
6969 'should mutate with `processor: undefined` and options' ,
7070 async function ( ) {
71+ // This tests the file set passed by `unified-engine`.
7172 assert . equal (
7273 String (
7374 await unified ( )
7475 . use ( remarkParse )
75- // @ts -expect-error: this tests the file set passed by `unified-engine`.
7676 . use ( remarkRehype , undefined , { handlers : { text} } )
7777 . use ( rehypeStringify )
7878 . process ( '# hi' )
@@ -87,7 +87,6 @@ test('remarkRehype', async function (t) {
8787 String (
8888 await unified ( )
8989 . use ( remarkParse )
90- // @ts -expect-error: TS currently barfs on overloads that result in mutate/bridges.
9190 . use ( remarkRehype , unified ( ) )
9291 . use ( remarkStringify )
9392 . process ( '## Hello, world! ##' )
@@ -101,7 +100,6 @@ test('remarkRehype', async function (t) {
101100 String (
102101 await unified ( )
103102 . use ( remarkParse )
104- // @ts -expect-error: TS currently barfs on overloads that result in mutate/bridges.
105103 . use ( remarkRehype , unified ( ) , { allowDangerousHtml : true } )
106104 . use ( remarkStringify )
107105 . process ( '## Hello, <i>world</i>! ##' )
@@ -111,19 +109,18 @@ test('remarkRehype', async function (t) {
111109 } )
112110
113111 await t . test ( 'should understand bridge types' , async function ( ) {
114- const treeIn = unified ( ) . use ( remarkParse ) . parse ( 'hi' )
115- // @ts -expect-error: TS currently barfs on overloads that result in mutate/bridges.
112+ const treeIn = unified ( ) . use ( remarkParse ) . parse ( '# hi' )
116113 const treeOut = await unified ( ) . use ( remarkRehype , unified ( ) ) . run ( treeIn )
117114 // @ts -expect-error: TS currently barfs on overloads that result in mutate/bridges.
118115 const document = unified ( ) . use ( remarkStringify ) . stringify ( treeOut )
119- assert . equal ( document , 'hi\n' )
116+ assert . equal ( document , '# hi\n' )
120117 } )
121118
122119 await t . test ( 'should understand mutate types' , async function ( ) {
123- const treeIn = unified ( ) . use ( remarkParse ) . parse ( 'hi' )
120+ const treeIn = unified ( ) . use ( remarkParse ) . parse ( '# hi' )
124121 const treeOut = await unified ( ) . use ( remarkRehype ) . run ( treeIn )
125122 const document = unified ( ) . use ( rehypeStringify ) . stringify ( treeOut )
126- assert . equal ( document , '<p >hi</p >' )
123+ assert . equal ( document , '<h1 >hi</h1 >' )
127124 } )
128125} )
129126
0 commit comments