@@ -9,90 +9,88 @@ test('unist-util-is', function(t) {
9
9
10
10
t . throws (
11
11
function ( ) {
12
- is ( false )
12
+ is ( null , false )
13
13
} ,
14
14
/ E x p e c t e d f u n c t i o n , s t r i n g , o r o b j e c t a s t e s t / ,
15
15
'should throw when `test` is invalid'
16
16
)
17
17
18
18
t . throws (
19
19
function ( ) {
20
- is ( null , node , - 1 , parent )
20
+ is ( node , null , - 1 , parent )
21
21
} ,
22
22
/ E x p e c t e d p o s i t i v e f i n i t e i n d e x o r c h i l d n o d e / ,
23
23
'should throw when `index` is invalid (#1)'
24
24
)
25
25
26
26
t . throws (
27
27
function ( ) {
28
- is ( null , node , Infinity , parent )
28
+ is ( node , null , Infinity , parent )
29
29
} ,
30
30
/ E x p e c t e d p o s i t i v e f i n i t e i n d e x o r c h i l d n o d e / ,
31
31
'should throw when `index` is invalid (#2)'
32
32
)
33
33
34
34
t . throws (
35
35
function ( ) {
36
- is ( null , node , false , parent )
36
+ is ( node , null , false , parent )
37
37
} ,
38
38
/ E x p e c t e d p o s i t i v e f i n i t e i n d e x o r c h i l d n o d e / ,
39
39
'should throw when `index` is invalid (#3)'
40
40
)
41
41
42
42
t . throws (
43
43
function ( ) {
44
- is ( null , node , 0 , { } )
44
+ is ( node , null , 0 , { } )
45
45
} ,
46
46
/ E x p e c t e d p a r e n t n o d e / ,
47
47
'should throw when `parent` is invalid (#1)'
48
48
)
49
49
50
50
t . throws (
51
51
function ( ) {
52
- is ( null , node , 0 , {
53
- type : 'paragraph'
54
- } )
52
+ is ( node , null , 0 , { type : 'paragraph' } )
55
53
} ,
56
54
/ E x p e c t e d p a r e n t n o d e / ,
57
55
'should throw when `parent` is invalid (#2)'
58
56
)
59
57
60
58
t . throws (
61
59
function ( ) {
62
- is ( null , node , 0 )
60
+ is ( node , null , 0 )
63
61
} ,
64
62
/ E x p e c t e d b o t h p a r e n t a n d i n d e x / ,
65
63
'should throw `parent` xor `index` are given (#1)'
66
64
)
67
65
68
66
t . throws (
69
67
function ( ) {
70
- is ( null , node , null , parent )
68
+ is ( node , null , null , parent )
71
69
} ,
72
70
/ E x p e c t e d b o t h p a r e n t a n d i n d e x / ,
73
71
'should throw `parent` xor `index` are given (#2)'
74
72
)
75
73
76
74
t . notok ( is ( ) , 'should not fail without node' )
77
- t . ok ( is ( null , node ) , 'should check if given a node (#1)' )
78
- t . notok ( is ( null , { children : [ ] } ) , 'should check if given a node (#2)' )
75
+ t . ok ( is ( node ) , 'should check if given a node (#1)' )
76
+ t . notok ( is ( { children : [ ] } , null ) , 'should check if given a node (#2)' )
79
77
80
- t . ok ( is ( 'strong' , node ) , 'should match types (#1)' )
81
- t . notok ( is ( 'emphasis' , node ) , 'should match types (#2)' )
78
+ t . ok ( is ( node , 'strong' ) , 'should match types (#1)' )
79
+ t . notok ( is ( node , 'emphasis' ) , 'should match types (#2)' )
82
80
83
81
t . ok ( is ( node , node ) , 'should match partially (#1)' )
84
- t . ok ( is ( { type : 'strong' } , node ) , 'should match partially (#2)' )
85
- t . ok ( is ( { type : 'paragraph' } , parent ) , 'should match partially (#3)' )
86
- t . notok ( is ( { type : 'paragraph' } , node ) , 'should match partially (#4)' )
82
+ t . ok ( is ( node , { type : 'strong' } ) , 'should match partially (#2)' )
83
+ t . ok ( is ( parent , { type : 'paragraph' } ) , 'should match partially (#3)' )
84
+ t . notok ( is ( node , { type : 'paragraph' } ) , 'should match partially (#4)' )
87
85
88
86
t . test ( 'should accept a test' , function ( st ) {
89
87
function test ( node , n ) {
90
88
return n === 5
91
89
}
92
90
93
- t . notok ( is ( test , node ) )
94
- t . notok ( is ( test , node , 0 , parent ) )
95
- st . ok ( is ( test , node , 5 , parent ) )
91
+ t . notok ( is ( node , test ) )
92
+ t . notok ( is ( node , test , 0 , parent ) )
93
+ st . ok ( is ( node , test , 5 , parent ) )
96
94
97
95
st . end ( )
98
96
} )
@@ -109,18 +107,18 @@ test('unist-util-is', function(t) {
109
107
st . equal ( c , parent )
110
108
}
111
109
112
- is ( test , node , 5 , parent , context )
110
+ is ( node , test , 5 , parent , context )
113
111
} )
114
112
115
- t . ok ( is ( [ 'strong' , 'emphasis' ] , node ) , 'should match arrays (#1)' )
116
- t . notok ( is ( [ 'b' , 'i' ] , node ) , 'should match arrays (#2)' )
113
+ t . ok ( is ( node , [ 'strong' , 'emphasis' ] ) , 'should match arrays (#1)' )
114
+ t . notok ( is ( node , [ 'b' , 'i' ] ) , 'should match arrays (#2)' )
117
115
118
116
t . test ( 'should match arrays (#3)' , function ( st ) {
119
117
var context = { foo : 'bar' }
120
118
121
119
st . plan ( 5 )
122
120
123
- st . ok ( is ( [ test , 'strong' ] , node , 5 , parent , context ) )
121
+ st . ok ( is ( node , [ test , 'strong' ] , 5 , parent , context ) )
124
122
125
123
function test ( a , b , c ) {
126
124
st . equal ( this , context )
0 commit comments