1
1
import assert from 'node:assert/strict'
2
2
import fs from 'node:fs/promises'
3
- import test from 'tape '
3
+ import test from 'node:test '
4
4
import { toHtml } from 'hast-util-to-html'
5
5
import { toHast } from 'mdast-util-to-hast'
6
6
import { fromMarkdown } from 'mdast-util-from-markdown'
@@ -11,8 +11,8 @@ import {
11
11
gfmAutolinkLiteralToMarkdown
12
12
} from '../index.js'
13
13
14
- test ( 'markdown -> mdast' , ( t ) => {
15
- t . deepEqual (
14
+ test ( 'markdown -> mdast' , ( ) => {
15
+ assert . deepEqual (
16
16
fromMarkdown (
17
17
'www.example.com, https://example.com, and [email protected] .' ,
18
18
{
@@ -122,7 +122,7 @@ test('markdown -> mdast', (t) => {
122
122
'should support autolink literals'
123
123
)
124
124
125
- t . deepEqual (
125
+ assert . deepEqual (
126
126
fromMarkdown ( '[https://google.com](https://google.com)' , {
127
127
extensions : [ gfmAutolinkLiteral ] ,
128
128
mdastExtensions : [ gfmAutolinkLiteralFromMarkdown ]
@@ -166,12 +166,10 @@ test('markdown -> mdast', (t) => {
166
166
} ,
167
167
'should support normal links'
168
168
)
169
-
170
- t . end ( )
171
169
} )
172
170
173
- test ( 'mdast -> markdown' , async ( t ) => {
174
- t . deepEqual (
171
+ test ( 'mdast -> markdown' , async ( ) => {
172
+ assert . deepEqual (
175
173
toMarkdown (
176
174
{
177
175
type : 'paragraph' ,
@@ -192,7 +190,7 @@ test('mdast -> markdown', async (t) => {
192
190
'should not serialize autolink literals'
193
191
)
194
192
195
- t . deepEqual (
193
+ assert . deepEqual (
196
194
toMarkdown (
197
195
{ type :
'paragraph' , children :
[ { type :
'text' , value :
'a [email protected] ' } ] } ,
198
196
{ extensions : [ gfmAutolinkLiteralToMarkdown ] }
@@ -201,7 +199,7 @@ test('mdast -> markdown', async (t) => {
201
199
'should escape at signs if they appear in what looks like an email'
202
200
)
203
201
204
- t . deepEqual (
202
+ assert . deepEqual (
205
203
toMarkdown (
206
204
{ type : 'paragraph' , children : [ { type : 'text' , value : 'a @c' } ] } ,
207
205
{ extensions : [ gfmAutolinkLiteralToMarkdown ] }
@@ -210,7 +208,7 @@ test('mdast -> markdown', async (t) => {
210
208
'should not escape at signs if they appear in what can’t be an email'
211
209
)
212
210
213
- t . deepEqual (
211
+ assert . deepEqual (
214
212
toMarkdown (
215
213
{ type : 'paragraph' , children : [ { type : 'text' , value : 'a www.b.c' } ] } ,
216
214
{ extensions : [ gfmAutolinkLiteralToMarkdown ] }
@@ -219,7 +217,7 @@ test('mdast -> markdown', async (t) => {
219
217
'should escape dots if they appear in what looks like a domain'
220
218
)
221
219
222
- t . deepEqual (
220
+ assert . deepEqual (
223
221
toMarkdown (
224
222
{ type : 'paragraph' , children : [ { type : 'text' , value : 'a.b' } ] } ,
225
223
{ extensions : [ gfmAutolinkLiteralToMarkdown ] }
@@ -228,7 +226,7 @@ test('mdast -> markdown', async (t) => {
228
226
'should not escape dots if they appear in what can’t be a domain'
229
227
)
230
228
231
- t . deepEqual (
229
+ assert . deepEqual (
232
230
toMarkdown (
233
231
{ type : 'paragraph' , children : [ { type : 'text' , value : 'https:/' } ] } ,
234
232
{ extensions : [ gfmAutolinkLiteralToMarkdown ] }
@@ -237,7 +235,7 @@ test('mdast -> markdown', async (t) => {
237
235
'should escape colons if they appear in what looks like a http protocol'
238
236
)
239
237
240
- t . deepEqual (
238
+ assert . deepEqual (
241
239
toMarkdown (
242
240
{ type : 'paragraph' , children : [ { type : 'text' , value : 'https:a' } ] } ,
243
241
{ extensions : [ gfmAutolinkLiteralToMarkdown ] }
@@ -246,7 +244,7 @@ test('mdast -> markdown', async (t) => {
246
244
'should not escape colons if they appear in what can’t be a http protocol'
247
245
)
248
246
249
- t . deepEqual (
247
+ assert . deepEqual (
250
248
toMarkdown (
251
249
{ type : 'definition' , label : 'http://a' , identifier : '' , url : '' } ,
252
250
{ extensions : [ gfmAutolinkLiteralToMarkdown ] }
@@ -255,7 +253,7 @@ test('mdast -> markdown', async (t) => {
255
253
'should not escape colons in definition labels'
256
254
)
257
255
258
- t . deepEqual (
256
+ assert . deepEqual (
259
257
toMarkdown (
260
258
{
261
259
type : 'paragraph' ,
@@ -275,7 +273,7 @@ test('mdast -> markdown', async (t) => {
275
273
'should not escape colons in link (reference) labels (shortcut)'
276
274
)
277
275
278
- t . deepEqual (
276
+ assert . deepEqual (
279
277
toMarkdown (
280
278
{
281
279
type : 'paragraph' ,
@@ -295,7 +293,7 @@ test('mdast -> markdown', async (t) => {
295
293
'should not escape colons in link (reference) labels (text)'
296
294
)
297
295
298
- t . deepEqual (
296
+ assert . deepEqual (
299
297
toMarkdown (
300
298
{
301
299
type : 'paragraph' ,
@@ -315,7 +313,7 @@ test('mdast -> markdown', async (t) => {
315
313
'should not escape colons in link (reference) labels (label)'
316
314
)
317
315
318
- t . deepEqual (
316
+ assert . deepEqual (
319
317
toMarkdown (
320
318
{
321
319
type : 'paragraph' ,
@@ -333,7 +331,7 @@ test('mdast -> markdown', async (t) => {
333
331
'should not escape colons in link (resource) labels'
334
332
)
335
333
336
- t . deepEqual (
334
+ assert . deepEqual (
337
335
toMarkdown (
338
336
{
339
337
type : 'paragraph' ,
@@ -353,7 +351,7 @@ test('mdast -> markdown', async (t) => {
353
351
'should not escape colons in image (reference) labels (label)'
354
352
)
355
353
356
- t . deepEqual (
354
+ assert . deepEqual (
357
355
toMarkdown (
358
356
{
359
357
type : 'paragraph' ,
@@ -373,7 +371,7 @@ test('mdast -> markdown', async (t) => {
373
371
'should not escape colons in image (reference) labels (alt)'
374
372
)
375
373
376
- t . deepEqual (
374
+ assert . deepEqual (
377
375
toMarkdown (
378
376
{
379
377
type : 'paragraph' ,
@@ -419,8 +417,6 @@ test('mdast -> markdown', async (t) => {
419
417
actual += '\n'
420
418
}
421
419
422
- t . deepEqual ( actual , expected , stem )
420
+ assert . deepEqual ( actual , expected , stem )
423
421
}
424
-
425
- t . end ( )
426
422
} )
0 commit comments