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 ( 'toString()' , ( t ) => {
6
- t . throws (
6
+ test ( 'toString()' , ( ) => {
7
+ assert . throws (
7
8
( ) => {
8
9
// @ts -expect-error: runtime.
9
10
toString ( )
@@ -12,7 +13,7 @@ test('toString()', (t) => {
12
13
'should throw when not given a node (#1)'
13
14
)
14
15
15
- t . throws (
16
+ assert . throws (
16
17
( ) => {
17
18
// @ts -expect-error: missing `type`.
18
19
toString ( { value : 'foo' } )
@@ -21,9 +22,9 @@ test('toString()', (t) => {
21
22
'should throw when not given a node (#2)'
22
23
)
23
24
24
- t . equal ( toString ( u ( 'TextNode' , 'AT' ) ) , 'AT' , 'should support texts' )
25
+ assert . equal ( toString ( u ( 'TextNode' , 'AT' ) ) , 'AT' , 'should support texts' )
25
26
26
- t . equal (
27
+ assert . equal (
27
28
toString (
28
29
u ( 'WordNode' , [
29
30
u ( 'TextNode' , 'AT' ) ,
@@ -35,13 +36,13 @@ test('toString()', (t) => {
35
36
'should support parents'
36
37
)
37
38
38
- t . equal (
39
+ assert . equal (
39
40
toString ( [ u ( 'TextNode' , 'AT' ) , u ( 'SymbolNode' , '&' ) , u ( 'TextNode' , 'T' ) ] ) ,
40
41
'AT&T' ,
41
42
'should support nodes'
42
43
)
43
44
44
- t . equal (
45
+ assert . equal (
45
46
toString (
46
47
// @ts -expect-error: custom.
47
48
u ( 'WordNode' , [
@@ -54,7 +55,7 @@ test('toString()', (t) => {
54
55
'should support parents with mixed children'
55
56
)
56
57
57
- t . equal (
58
+ assert . equal (
58
59
toString (
59
60
// @ts -expect-error: custom.
60
61
u ( 'WordNode' , [
@@ -69,7 +70,5 @@ test('toString()', (t) => {
69
70
)
70
71
71
72
// @ts -expect-error: custom node.
72
- t . equal ( toString ( u ( 'VoidNode' ) ) , '' , 'should support voids' )
73
-
74
- t . end ( )
73
+ assert . equal ( toString ( u ( 'VoidNode' ) ) , '' , 'should support voids' )
75
74
} )
0 commit comments