33var test = require ( 'tape' )
44var is = require ( '.' )
55
6- test ( 'unist-util-is' , function ( t ) {
6+ test ( 'unist-util-is' , function ( t ) {
77 var node = { type : 'strong' }
88 var parent = { type : 'paragraph' , children : [ ] }
99
1010 t . throws (
11- function ( ) {
11+ function ( ) {
1212 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 (
19- function ( ) {
19+ function ( ) {
2020 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 (
27- function ( ) {
27+ function ( ) {
2828 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 (
35- function ( ) {
35+ function ( ) {
3636 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 (
43- function ( ) {
43+ function ( ) {
4444 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 (
51- function ( ) {
51+ function ( ) {
5252 is ( node , null , 0 , { type : 'paragraph' } )
5353 } ,
5454 / E x p e c t e d p a r e n t n o d e / ,
5555 'should throw when `parent` is invalid (#2)'
5656 )
5757
5858 t . throws (
59- function ( ) {
59+ function ( ) {
6060 is ( node , null , 0 )
6161 } ,
6262 / 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 / ,
6363 'should throw `parent` xor `index` are given (#1)'
6464 )
6565
6666 t . throws (
67- function ( ) {
67+ function ( ) {
6868 is ( node , null , null , parent )
6969 } ,
7070 / 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 / ,
@@ -83,28 +83,28 @@ test('unist-util-is', function(t) {
8383 t . ok ( is ( parent , { type : 'paragraph' } ) , 'should match partially (#3)' )
8484 t . notok ( is ( node , { type : 'paragraph' } ) , 'should match partially (#4)' )
8585
86- t . test ( 'should accept a test' , function ( st ) {
86+ t . test ( 'should accept a test' , function ( t ) {
8787 function test ( node , n ) {
8888 return n === 5
8989 }
9090
9191 t . notok ( is ( node , test ) )
9292 t . notok ( is ( node , test , 0 , parent ) )
93- st . ok ( is ( node , test , 5 , parent ) )
93+ t . ok ( is ( node , test , 5 , parent ) )
9494
95- st . end ( )
95+ t . end ( )
9696 } )
9797
98- t . test ( 'should invoke test' , function ( st ) {
98+ t . test ( 'should invoke test' , function ( t ) {
9999 var context = { foo : 'bar' }
100100
101- st . plan ( 4 )
101+ t . plan ( 4 )
102102
103103 function test ( a , b , c ) {
104- st . equal ( this , context )
105- st . equal ( a , node )
106- st . equal ( b , 5 )
107- st . equal ( c , parent )
104+ t . equal ( this , context )
105+ t . equal ( a , node )
106+ t . equal ( b , 5 )
107+ t . equal ( c , parent )
108108 }
109109
110110 is ( node , test , 5 , parent , context )
@@ -113,18 +113,18 @@ test('unist-util-is', function(t) {
113113 t . ok ( is ( node , [ 'strong' , 'emphasis' ] ) , 'should match arrays (#1)' )
114114 t . notok ( is ( node , [ 'b' , 'i' ] ) , 'should match arrays (#2)' )
115115
116- t . test ( 'should match arrays (#3)' , function ( st ) {
116+ t . test ( 'should match arrays (#3)' , function ( t ) {
117117 var context = { foo : 'bar' }
118118
119- st . plan ( 5 )
119+ t . plan ( 5 )
120120
121- st . ok ( is ( node , [ test , 'strong' ] , 5 , parent , context ) )
121+ t . ok ( is ( node , [ test , 'strong' ] , 5 , parent , context ) )
122122
123123 function test ( a , b , c ) {
124- st . equal ( this , context )
125- st . equal ( a , node )
126- st . equal ( b , 5 )
127- st . equal ( c , parent )
124+ t . equal ( this , context )
125+ t . equal ( a , node )
126+ t . equal ( b , 5 )
127+ t . equal ( c , parent )
128128 return false
129129 }
130130 } )
0 commit comments