1
- import test from 'tape'
1
+ import assert from 'node:assert/strict'
2
+ import test from 'node:test'
2
3
import { fromMarkdown } from 'mdast-util-from-markdown'
3
4
import { toMarkdown } from 'mdast-util-to-markdown'
4
5
import { gfmFootnote } from 'micromark-extension-gfm-footnote'
5
6
import { gfmFootnoteFromMarkdown , gfmFootnoteToMarkdown } from './index.js'
6
7
7
- test ( 'markdown -> mdast' , ( t ) => {
8
- t . deepEqual (
8
+ test ( 'markdown -> mdast' , ( ) => {
9
+ assert . deepEqual (
9
10
fromMarkdown ( '[^a]: b\nc\n\n d' , {
10
11
extensions : [ gfmFootnote ( ) ] ,
11
12
mdastExtensions : [ gfmFootnoteFromMarkdown ( ) ]
@@ -67,7 +68,7 @@ test('markdown -> mdast', (t) => {
67
68
'should support a footnote definition'
68
69
)
69
70
70
- t . deepEqual (
71
+ assert . deepEqual (
71
72
fromMarkdown ( 'Call.[^a]\n[^a]: b' , {
72
73
extensions : [ gfmFootnote ( ) ] ,
73
74
mdastExtensions : [ gfmFootnoteFromMarkdown ( ) ]
@@ -101,7 +102,7 @@ test('markdown -> mdast', (t) => {
101
102
'should support a footnote call'
102
103
)
103
104
104
- t . deepEqual (
105
+ assert . deepEqual (
105
106
fromMarkdown ( '![^a]\n[^a]: b' , {
106
107
extensions : [ gfmFootnote ( ) ] ,
107
108
mdastExtensions : [ gfmFootnoteFromMarkdown ( ) ]
@@ -134,12 +135,10 @@ test('markdown -> mdast', (t) => {
134
135
} ,
135
136
'should support a footnote after an exclamation mark'
136
137
)
137
-
138
- t . end ( )
139
138
} )
140
139
141
- test ( 'mdast -> markdown' , ( t ) => {
142
- t . deepEqual (
140
+ test ( 'mdast -> markdown' , ( ) => {
141
+ assert . deepEqual (
143
142
toMarkdown (
144
143
{ type : 'footnoteReference' , identifier : 'a' } ,
145
144
{ extensions : [ gfmFootnoteToMarkdown ( ) ] }
@@ -148,7 +147,7 @@ test('mdast -> markdown', (t) => {
148
147
'should serialize a footnote reference w/ identifier'
149
148
)
150
149
151
- t . deepEqual (
150
+ assert . deepEqual (
152
151
toMarkdown (
153
152
// @ts -expect-error: `identifier` missing.
154
153
{ type : 'footnoteReference' , label : 'X]Y' } ,
@@ -158,7 +157,7 @@ test('mdast -> markdown', (t) => {
158
157
'should serialize a footnote reference w/ label'
159
158
)
160
159
161
- t . deepEqual (
160
+ assert . deepEqual (
162
161
toMarkdown (
163
162
{
164
163
type : 'paragraph' ,
@@ -174,7 +173,7 @@ test('mdast -> markdown', (t) => {
174
173
'should serialize a footnote reference in a paragraph'
175
174
)
176
175
177
- t . deepEqual (
176
+ assert . deepEqual (
178
177
toMarkdown (
179
178
// @ts -expect-error: `children` missing.
180
179
{ type : 'footnoteDefinition' , identifier : 'a' } ,
@@ -184,7 +183,7 @@ test('mdast -> markdown', (t) => {
184
183
'should serialize a footnote definition w/ identifier'
185
184
)
186
185
187
- t . deepEqual (
186
+ assert . deepEqual (
188
187
toMarkdown (
189
188
// @ts -expect-error: `identifier` missing.
190
189
{ type : 'footnoteDefinition' , label : 'X]Y' } ,
@@ -194,7 +193,7 @@ test('mdast -> markdown', (t) => {
194
193
'should serialize a footnote definition w/ label'
195
194
)
196
195
197
- t . deepEqual (
196
+ assert . deepEqual (
198
197
toMarkdown (
199
198
{
200
199
type : 'footnoteDefinition' ,
@@ -211,7 +210,7 @@ test('mdast -> markdown', (t) => {
211
210
'should serialize a footnote definition w/ content'
212
211
)
213
212
214
- t . deepEqual (
213
+ assert . deepEqual (
215
214
toMarkdown (
216
215
{
217
216
type : 'footnoteDefinition' ,
@@ -225,7 +224,7 @@ test('mdast -> markdown', (t) => {
225
224
'should serialize code in a footnote definition'
226
225
)
227
226
228
- t . deepEqual (
227
+ assert . deepEqual (
229
228
toMarkdown (
230
229
{
231
230
type : 'footnoteDefinition' ,
@@ -242,7 +241,7 @@ test('mdast -> markdown', (t) => {
242
241
'should serialize code as the 2nd child in a footnote definition'
243
242
)
244
243
245
- t . deepEqual (
244
+ assert . deepEqual (
246
245
toMarkdown (
247
246
{ type : 'paragraph' , children : [ { type : 'text' , value : 'b^[a]' } ] } ,
248
247
{ extensions : [ gfmFootnoteToMarkdown ( ) ] }
@@ -251,7 +250,7 @@ test('mdast -> markdown', (t) => {
251
250
'should escape what would otherwise be an inline note'
252
251
)
253
252
254
- t . deepEqual (
253
+ assert . deepEqual (
255
254
toMarkdown (
256
255
{ type : 'paragraph' , children : [ { type : 'text' , value : 'b[^a]' } ] } ,
257
256
{ extensions : [ gfmFootnoteToMarkdown ( ) ] }
@@ -260,7 +259,7 @@ test('mdast -> markdown', (t) => {
260
259
'should escape what would otherwise be an footnote call'
261
260
)
262
261
263
- t . deepEqual (
262
+ assert . deepEqual (
264
263
toMarkdown (
265
264
{ type : 'paragraph' , children : [ { type : 'text' , value : '[a]: b' } ] } ,
266
265
{ extensions : [ gfmFootnoteToMarkdown ( ) ] }
@@ -269,7 +268,7 @@ test('mdast -> markdown', (t) => {
269
268
'should escape what would otherwise be an footnote definition'
270
269
)
271
270
272
- t . deepEqual (
271
+ assert . deepEqual (
273
272
toMarkdown (
274
273
{ type : 'footnoteDefinition' , identifier : 'a:b' , children : [ ] } ,
275
274
{ extensions : [ gfmFootnoteToMarkdown ( ) ] }
@@ -278,7 +277,7 @@ test('mdast -> markdown', (t) => {
278
277
'should support colons in footnote definitions'
279
278
)
280
279
281
- t . deepEqual (
280
+ assert . deepEqual (
282
281
toMarkdown (
283
282
{
284
283
type : 'footnoteDefinition' ,
@@ -290,6 +289,4 @@ test('mdast -> markdown', (t) => {
290
289
'[^a]: *\n' ,
291
290
'should support lists in footnote definitions'
292
291
)
293
-
294
- t . end ( )
295
292
} )
0 commit comments