8
8
* @typedef {import('unist-util-visit/complex-types.js').Visitor<Word> } Visitor
9
9
*/
10
10
11
- import assert from 'node:assert'
12
- import test from 'tape '
11
+ import assert from 'node:assert/strict '
12
+ import test from 'node:test '
13
13
import { retext } from 'retext'
14
14
import { visit } from 'unist-util-visit'
15
15
import { isLiteral } from './index.js'
16
16
17
- test ( 'isLiteral()' , ( t ) => {
18
- t . throws (
17
+ test ( 'isLiteral()' , ( ) => {
18
+ assert . throws (
19
19
( ) => {
20
20
// @ts -expect-error runtime.
21
21
isLiteral ( )
@@ -24,7 +24,7 @@ test('isLiteral()', (t) => {
24
24
'should throw without arguments'
25
25
)
26
26
27
- t . throws (
27
+ assert . throws (
28
28
( ) => {
29
29
// @ts -expect-error runtime.
30
30
isLiteral ( { } )
@@ -33,7 +33,7 @@ test('isLiteral()', (t) => {
33
33
'should throw without parent'
34
34
)
35
35
36
- t . throws (
36
+ assert . throws (
37
37
( ) => {
38
38
// @ts -expect-error runtime.
39
39
isLiteral ( { children : [ ] } )
@@ -42,7 +42,7 @@ test('isLiteral()', (t) => {
42
42
'should throw without node'
43
43
)
44
44
45
- t . throws (
45
+ assert . throws (
46
46
( ) => {
47
47
// @ts -expect-error runtime.
48
48
isLiteral ( { children : [ ] } , { type : 'a' } )
@@ -51,13 +51,13 @@ test('isLiteral()', (t) => {
51
51
'should throw if `node` is not in `parent`'
52
52
)
53
53
54
- t . doesNotThrow ( ( ) => {
54
+ assert . doesNotThrow ( ( ) => {
55
55
const n = { type : 'a' }
56
56
// @ts -expect-error runtime.
57
57
isLiteral ( { children : [ n ] } , n )
58
58
} , 'should not throw if `node` is in `parent`' )
59
59
60
- t . doesNotThrow ( ( ) => {
60
+ assert . doesNotThrow ( ( ) => {
61
61
process ( 'Well? Ha! Funky' , ( _ , index , parent_ ) => {
62
62
const parent = /** @type {Parent } */ ( parent_ )
63
63
assert . strictEqual (
@@ -67,7 +67,7 @@ test('isLiteral()', (t) => {
67
67
} )
68
68
} , 'should work on single word sentences' )
69
69
70
- t . doesNotThrow ( ( ) => {
70
+ assert . doesNotThrow ( ( ) => {
71
71
const fixtures = [
72
72
'Foo - is meant as a literal.' ,
73
73
'Foo – is meant as a literal.' ,
@@ -93,7 +93,7 @@ test('isLiteral()', (t) => {
93
93
}
94
94
} , 'Initial' )
95
95
96
- t . doesNotThrow ( ( ) => {
96
+ assert . doesNotThrow ( ( ) => {
97
97
const fixtures = [
98
98
'Meant as a literal is - foo.' ,
99
99
'Meant as a literal is – foo.' ,
@@ -119,7 +119,7 @@ test('isLiteral()', (t) => {
119
119
}
120
120
} , 'Final' )
121
121
122
- t . doesNotThrow ( ( ) => {
122
+ assert . doesNotThrow ( ( ) => {
123
123
const fixtures = [
124
124
'The word, foo, is meant as a literal.' ,
125
125
'The word -foo- is meant as a literal.' ,
@@ -173,8 +173,6 @@ test('isLiteral()', (t) => {
173
173
} )
174
174
}
175
175
} , 'Internal' )
176
-
177
- t . end ( )
178
176
} )
179
177
180
178
/**
0 commit comments