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 { toString } from './index.js'
4
5
5
- test ( 'xast-util-to-string' , ( t ) => {
6
- t . deepEqual (
6
+ test ( 'xast-util-to-string' , ( ) => {
7
+ assert . deepEqual (
7
8
toString ( u ( 'cdata' , '<greeting>Hello, world!</greeting>' ) ) ,
8
9
'<greeting>Hello, world!</greeting>' ,
9
10
'should serialize cdata'
10
11
)
11
12
12
- t . deepEqual ( toString ( u ( 'comment' , 'foo' ) ) , 'foo' , 'should serialize comments' )
13
+ assert . deepEqual (
14
+ toString ( u ( 'comment' , 'foo' ) ) ,
15
+ 'foo' ,
16
+ 'should serialize comments'
17
+ )
13
18
14
- t . deepEqual (
19
+ assert . deepEqual (
15
20
toString ( u ( 'instruction' , { name : 'xml' } , 'version="1.0" encoding="UTF-8"' ) ) ,
16
21
'version="1.0" encoding="UTF-8"' ,
17
22
'should serialize instructions'
18
23
)
19
24
20
- t . deepEqual ( toString ( u ( 'text' , 'foo' ) ) , 'foo' , 'should serialize texts' )
25
+ assert . deepEqual ( toString ( u ( 'text' , 'foo' ) ) , 'foo' , 'should serialize texts' )
21
26
22
- t . deepEqual (
27
+ assert . deepEqual (
23
28
toString ( u ( 'doctype' , { name : 'html' } ) ) ,
24
29
'' ,
25
30
'should return empty for doctypes'
26
31
)
27
32
28
- t . deepEqual (
33
+ assert . deepEqual (
29
34
toString (
30
35
u ( 'element' , { name : 'package' } , [
31
36
u ( 'text' , 'foo ' ) ,
@@ -37,7 +42,7 @@ test('xast-util-to-string', (t) => {
37
42
'should serialize elements (excluding non-parent and non-text descendants)'
38
43
)
39
44
40
- t . deepEqual (
45
+ assert . deepEqual (
41
46
toString (
42
47
u ( 'root' , [
43
48
u ( 'doctype' , { name : 'html' } ) ,
@@ -49,6 +54,4 @@ test('xast-util-to-string', (t) => {
49
54
'foo baz' ,
50
55
'should serialize roots (excluding non-parent and non-text descendants)'
51
56
)
52
-
53
- t . end ( )
54
57
} )
0 commit comments