1
- import test from 'tape'
1
+ import assert from 'node:assert/strict'
2
+ import test from 'node:test'
2
3
import { u } from 'unist-builder'
3
4
import { h } from 'hastscript'
4
5
import { removePosition } from 'unist-util-remove-position'
@@ -9,8 +10,8 @@ import {mdxFromMarkdown} from 'mdast-util-mdx'
9
10
import { toHast } from 'mdast-util-to-hast'
10
11
import { excerpt } from './index.js'
11
12
12
- test ( 'hastUtilExcerpt ' , ( t ) => {
13
- t . deepEqual (
13
+ test ( 'excerpt ' , ( ) => {
14
+ assert . deepEqual (
14
15
excerpt (
15
16
h ( 'div' , [
16
17
h ( 'p' , 'Lorem ipsum dolor sit amet.' ) ,
@@ -22,7 +23,7 @@ test('hastUtilExcerpt', (t) => {
22
23
'should copy to an excerpt comment'
23
24
)
24
25
25
- t . deepEqual (
26
+ assert . deepEqual (
26
27
excerpt (
27
28
h ( 'div' , [
28
29
h ( 'p' , 'Lorem ipsum dolor sit amet.' ) ,
@@ -35,7 +36,7 @@ test('hastUtilExcerpt', (t) => {
35
36
'should support `maxSearchSize`'
36
37
)
37
38
38
- t . deepEqual (
39
+ assert . deepEqual (
39
40
excerpt (
40
41
h ( 'div' , [
41
42
h ( 'p' , [
@@ -49,7 +50,7 @@ test('hastUtilExcerpt', (t) => {
49
50
'should copy to an excerpt comment inside a paragraph'
50
51
)
51
52
52
- t . deepEqual (
53
+ assert . deepEqual (
53
54
excerpt (
54
55
h ( 'div' , [
55
56
h ( 'p' , 'Lorem ipsum dolor sit amet.' ) ,
@@ -60,7 +61,7 @@ test('hastUtilExcerpt', (t) => {
60
61
'should return `undefined` if there’s no comment'
61
62
)
62
63
63
- t . deepEqual (
64
+ assert . deepEqual (
64
65
excerpt (
65
66
h ( 'div' , [
66
67
h ( 'p' , 'Lorem ipsum dolor sit amet.' ) ,
@@ -72,7 +73,7 @@ test('hastUtilExcerpt', (t) => {
72
73
'should not match on comments with other values'
73
74
)
74
75
75
- t . deepEqual (
76
+ assert . deepEqual (
76
77
excerpt (
77
78
h ( 'div' , [
78
79
h ( 'p' , 'Lorem ipsum dolor sit amet.' ) ,
@@ -91,13 +92,13 @@ test('hastUtilExcerpt', (t) => {
91
92
h ( 'p' , 'Consectetur adipisicing elit.' )
92
93
] )
93
94
94
- t . deepEqual (
95
+ assert . deepEqual (
95
96
excerpt ( tree , { ignore : selectAll ( 'del' , tree ) } ) ,
96
97
h ( 'div' , [ h ( 'p' , [ 'Lorem ipsum ' , ' sit amet.' ] ) ] ) ,
97
98
'should support `ignore`'
98
99
)
99
100
100
- t . deepEqual (
101
+ assert . deepEqual (
101
102
excerpt (
102
103
// @ts -expect-error: hush!
103
104
toHast (
@@ -113,6 +114,4 @@ test('hastUtilExcerpt', (t) => {
113
114
u ( 'root' , [ h ( 'p' , 'Some text' ) , u ( 'text' , '\n' ) ] ) ,
114
115
'should integrate w/ `mdast-util-mdx` (support `/* comments */`)'
115
116
)
116
-
117
- t . end ( )
118
117
} )
0 commit comments