@@ -9,90 +9,88 @@ test('unist-util-is', function(t) {
99
1010 t . throws (
1111 function ( ) {
12- is ( false )
12+ is ( null , false )
1313 } ,
1414 / 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 / ,
1515 'should throw when `test` is invalid'
1616 )
1717
1818 t . throws (
1919 function ( ) {
20- is ( null , node , - 1 , parent )
20+ is ( node , null , - 1 , parent )
2121 } ,
2222 / 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 / ,
2323 'should throw when `index` is invalid (#1)'
2424 )
2525
2626 t . throws (
2727 function ( ) {
28- is ( null , node , Infinity , parent )
28+ is ( node , null , Infinity , parent )
2929 } ,
3030 / 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 / ,
3131 'should throw when `index` is invalid (#2)'
3232 )
3333
3434 t . throws (
3535 function ( ) {
36- is ( null , node , false , parent )
36+ is ( node , null , false , parent )
3737 } ,
3838 / 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 / ,
3939 'should throw when `index` is invalid (#3)'
4040 )
4141
4242 t . throws (
4343 function ( ) {
44- is ( null , node , 0 , { } )
44+ is ( node , null , 0 , { } )
4545 } ,
4646 / E x p e c t e d p a r e n t n o d e / ,
4747 'should throw when `parent` is invalid (#1)'
4848 )
4949
5050 t . throws (
5151 function ( ) {
52- is ( null , node , 0 , {
53- type : 'paragraph'
54- } )
52+ is ( node , null , 0 , { type : 'paragraph' } )
5553 } ,
5654 / E x p e c t e d p a r e n t n o d e / ,
5755 'should throw when `parent` is invalid (#2)'
5856 )
5957
6058 t . throws (
6159 function ( ) {
62- is ( null , node , 0 )
60+ is ( node , null , 0 )
6361 } ,
6462 / 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 / ,
6563 'should throw `parent` xor `index` are given (#1)'
6664 )
6765
6866 t . throws (
6967 function ( ) {
70- is ( null , node , null , parent )
68+ is ( node , null , null , parent )
7169 } ,
7270 / 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 / ,
7371 'should throw `parent` xor `index` are given (#2)'
7472 )
7573
7674 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)' )
7977
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)' )
8280
8381 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)' )
8785
8886 t . test ( 'should accept a test' , function ( st ) {
8987 function test ( node , n ) {
9088 return n === 5
9189 }
9290
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 ) )
9694
9795 st . end ( )
9896 } )
@@ -109,18 +107,18 @@ test('unist-util-is', function(t) {
109107 st . equal ( c , parent )
110108 }
111109
112- is ( test , node , 5 , parent , context )
110+ is ( node , test , 5 , parent , context )
113111 } )
114112
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)' )
117115
118116 t . test ( 'should match arrays (#3)' , function ( st ) {
119117 var context = { foo : 'bar' }
120118
121119 st . plan ( 5 )
122120
123- st . ok ( is ( [ test , 'strong' ] , node , 5 , parent , context ) )
121+ st . ok ( is ( node , [ test , 'strong' ] , 5 , parent , context ) )
124122
125123 function test ( a , b , c ) {
126124 st . equal ( this , context )
0 commit comments