1- import test from 'tape'
1+ import assert from 'node:assert/strict'
2+ import test from 'node:test'
23import { fromMarkdown } from 'mdast-util-from-markdown'
34import { toMarkdown } from 'mdast-util-to-markdown'
45import { gfmFootnote } from 'micromark-extension-gfm-footnote'
56import { gfmFootnoteFromMarkdown , gfmFootnoteToMarkdown } from './index.js'
67
7- test ( 'markdown -> mdast' , ( t ) => {
8- t . deepEqual (
8+ test ( 'markdown -> mdast' , ( ) => {
9+ assert . deepEqual (
910 fromMarkdown ( '[^a]: b\nc\n\n d' , {
1011 extensions : [ gfmFootnote ( ) ] ,
1112 mdastExtensions : [ gfmFootnoteFromMarkdown ( ) ]
@@ -67,7 +68,7 @@ test('markdown -> mdast', (t) => {
6768 'should support a footnote definition'
6869 )
6970
70- t . deepEqual (
71+ assert . deepEqual (
7172 fromMarkdown ( 'Call.[^a]\n[^a]: b' , {
7273 extensions : [ gfmFootnote ( ) ] ,
7374 mdastExtensions : [ gfmFootnoteFromMarkdown ( ) ]
@@ -101,7 +102,7 @@ test('markdown -> mdast', (t) => {
101102 'should support a footnote call'
102103 )
103104
104- t . deepEqual (
105+ assert . deepEqual (
105106 fromMarkdown ( '![^a]\n[^a]: b' , {
106107 extensions : [ gfmFootnote ( ) ] ,
107108 mdastExtensions : [ gfmFootnoteFromMarkdown ( ) ]
@@ -134,12 +135,10 @@ test('markdown -> mdast', (t) => {
134135 } ,
135136 'should support a footnote after an exclamation mark'
136137 )
137-
138- t . end ( )
139138} )
140139
141- test ( 'mdast -> markdown' , ( t ) => {
142- t . deepEqual (
140+ test ( 'mdast -> markdown' , ( ) => {
141+ assert . deepEqual (
143142 toMarkdown (
144143 { type : 'footnoteReference' , identifier : 'a' } ,
145144 { extensions : [ gfmFootnoteToMarkdown ( ) ] }
@@ -148,7 +147,7 @@ test('mdast -> markdown', (t) => {
148147 'should serialize a footnote reference w/ identifier'
149148 )
150149
151- t . deepEqual (
150+ assert . deepEqual (
152151 toMarkdown (
153152 // @ts -expect-error: `identifier` missing.
154153 { type : 'footnoteReference' , label : 'X]Y' } ,
@@ -158,7 +157,7 @@ test('mdast -> markdown', (t) => {
158157 'should serialize a footnote reference w/ label'
159158 )
160159
161- t . deepEqual (
160+ assert . deepEqual (
162161 toMarkdown (
163162 {
164163 type : 'paragraph' ,
@@ -174,7 +173,7 @@ test('mdast -> markdown', (t) => {
174173 'should serialize a footnote reference in a paragraph'
175174 )
176175
177- t . deepEqual (
176+ assert . deepEqual (
178177 toMarkdown (
179178 // @ts -expect-error: `children` missing.
180179 { type : 'footnoteDefinition' , identifier : 'a' } ,
@@ -184,7 +183,7 @@ test('mdast -> markdown', (t) => {
184183 'should serialize a footnote definition w/ identifier'
185184 )
186185
187- t . deepEqual (
186+ assert . deepEqual (
188187 toMarkdown (
189188 // @ts -expect-error: `identifier` missing.
190189 { type : 'footnoteDefinition' , label : 'X]Y' } ,
@@ -194,7 +193,7 @@ test('mdast -> markdown', (t) => {
194193 'should serialize a footnote definition w/ label'
195194 )
196195
197- t . deepEqual (
196+ assert . deepEqual (
198197 toMarkdown (
199198 {
200199 type : 'footnoteDefinition' ,
@@ -211,7 +210,7 @@ test('mdast -> markdown', (t) => {
211210 'should serialize a footnote definition w/ content'
212211 )
213212
214- t . deepEqual (
213+ assert . deepEqual (
215214 toMarkdown (
216215 {
217216 type : 'footnoteDefinition' ,
@@ -225,7 +224,7 @@ test('mdast -> markdown', (t) => {
225224 'should serialize code in a footnote definition'
226225 )
227226
228- t . deepEqual (
227+ assert . deepEqual (
229228 toMarkdown (
230229 {
231230 type : 'footnoteDefinition' ,
@@ -242,7 +241,7 @@ test('mdast -> markdown', (t) => {
242241 'should serialize code as the 2nd child in a footnote definition'
243242 )
244243
245- t . deepEqual (
244+ assert . deepEqual (
246245 toMarkdown (
247246 { type : 'paragraph' , children : [ { type : 'text' , value : 'b^[a]' } ] } ,
248247 { extensions : [ gfmFootnoteToMarkdown ( ) ] }
@@ -251,7 +250,7 @@ test('mdast -> markdown', (t) => {
251250 'should escape what would otherwise be an inline note'
252251 )
253252
254- t . deepEqual (
253+ assert . deepEqual (
255254 toMarkdown (
256255 { type : 'paragraph' , children : [ { type : 'text' , value : 'b[^a]' } ] } ,
257256 { extensions : [ gfmFootnoteToMarkdown ( ) ] }
@@ -260,7 +259,7 @@ test('mdast -> markdown', (t) => {
260259 'should escape what would otherwise be an footnote call'
261260 )
262261
263- t . deepEqual (
262+ assert . deepEqual (
264263 toMarkdown (
265264 { type : 'paragraph' , children : [ { type : 'text' , value : '[a]: b' } ] } ,
266265 { extensions : [ gfmFootnoteToMarkdown ( ) ] }
@@ -269,7 +268,7 @@ test('mdast -> markdown', (t) => {
269268 'should escape what would otherwise be an footnote definition'
270269 )
271270
272- t . deepEqual (
271+ assert . deepEqual (
273272 toMarkdown (
274273 { type : 'footnoteDefinition' , identifier : 'a:b' , children : [ ] } ,
275274 { extensions : [ gfmFootnoteToMarkdown ( ) ] }
@@ -278,7 +277,7 @@ test('mdast -> markdown', (t) => {
278277 'should support colons in footnote definitions'
279278 )
280279
281- t . deepEqual (
280+ assert . deepEqual (
282281 toMarkdown (
283282 {
284283 type : 'footnoteDefinition' ,
@@ -290,6 +289,4 @@ test('mdast -> markdown', (t) => {
290289 '[^a]: *\n' ,
291290 'should support lists in footnote definitions'
292291 )
293-
294- t . end ( )
295292} )
0 commit comments