1
1
/**
2
- * @typedef {import('unist ').Node } Node
2
+ * @typedef {import('mdast ').Root|import('mdast').Content } Node
3
3
*/
4
4
5
5
import test from 'tape'
@@ -12,14 +12,16 @@ test('mdast-util-definitions', (t) => {
12
12
13
13
t . throws (
14
14
( ) => {
15
- // @ts -ignore runtime
15
+ // @ts -expect-error runtime
16
16
definitions ( )
17
17
} ,
18
18
/ m d a s t - u t i l - d e f i n i t i o n s e x p e c t e d n o d e / ,
19
19
'should fail without node'
20
20
)
21
21
22
- tree = remark ( ) . parse ( '[example]: https://example.com "Example"' )
22
+ tree = /** @type {Node } */ (
23
+ remark ( ) . parse ( '[example]: https://example.com "Example"' )
24
+ )
23
25
24
26
t . deepLooseEqual (
25
27
definitions ( tree ) ( 'example' ) ,
@@ -39,7 +41,9 @@ test('mdast-util-definitions', (t) => {
39
41
40
42
t . equal ( definitions ( tree ) ( 'foo' ) , null , 'should return null when not found' )
41
43
42
- tree = remark ( ) . parse ( '[__proto__]: https://proto.com "Proto"' )
44
+ tree = /** @type {Node } */ (
45
+ remark ( ) . parse ( '[__proto__]: https://proto.com "Proto"' )
46
+ )
43
47
44
48
t . deepLooseEqual (
45
49
definitions ( tree ) ( '__proto__' ) ,
@@ -69,8 +73,8 @@ test('mdast-util-definitions', (t) => {
69
73
'should work on weird identifiers when not found'
70
74
)
71
75
72
- tree = remark ( ) . parse (
73
- '[example]: https://one.com\n[example]: https://two.com'
76
+ tree = /** @type { Node } */ (
77
+ remark ( ) . parse ( '[example]: https://one.com\n[example]: https://two.com' )
74
78
)
75
79
76
80
const example = definitions ( tree ) ( 'example' )
0 commit comments