1
+ /**
2
+ * @typedef {import('unist').Node } Node
3
+ */
4
+
1
5
import test from 'tape'
2
6
import fc from 'fast-check'
3
7
import lodash from 'lodash'
@@ -10,6 +14,7 @@ test('unist-util-is properties', (t) => {
10
14
t . doesNotThrow (
11
15
( ) =>
12
16
fc . assert (
17
+ // @ts -expect-error: fine.
13
18
fc . property ( fc . record ( { type : fc . string ( { minLength : 1 } ) } ) , ( node ) =>
14
19
is ( node )
15
20
)
@@ -21,10 +26,11 @@ test('unist-util-is properties', (t) => {
21
26
( ) =>
22
27
fc . assert (
23
28
fc . property (
24
- fc . unicodeJsonObject ( ) . filter (
29
+ fc . unicodeJsonValue ( ) . filter (
25
30
// @ts -expect-error Looks like a node.
26
31
( node ) => ! ( isPlainObject ( node ) && typeof node . type === 'string' )
27
32
) ,
33
+ // @ts -expect-error: fine.
28
34
( node ) => ! is ( node )
29
35
)
30
36
) ,
@@ -34,9 +40,10 @@ test('unist-util-is properties', (t) => {
34
40
t . doesNotThrow (
35
41
( ) =>
36
42
fc . assert (
37
- fc . property ( fc . record ( { type : fc . string ( { minLength : 1 } ) } ) , ( node ) =>
43
+ // @ts -expect-error: fine.
44
+ fc . property ( fc . record ( { type : fc . string ( { minLength : 1 } ) } ) , node => {
38
45
is ( node , node . type )
39
- )
46
+ } )
40
47
) ,
41
48
'should match types'
42
49
)
@@ -45,9 +52,8 @@ test('unist-util-is properties', (t) => {
45
52
( ) =>
46
53
fc . assert (
47
54
fc . property (
48
- // @ts -expect-error: hush
49
55
fc
50
- . unicodeJsonObject ( )
56
+ . unicodeJsonValue ( )
51
57
// Filter for JSON objects which unist can work with
52
58
. filter (
53
59
( node ) =>
@@ -66,6 +72,7 @@ test('unist-util-is properties', (t) => {
66
72
)
67
73
)
68
74
) ,
75
+ // @ts -expect-error: fine.
69
76
fc . string ( { minLength : 1 } ) ,
70
77
(
71
78
/** @type {[Object.<string, unknown>, Array.<string>] } */ nodeAndKeys ,
0 commit comments