@@ -11,34 +11,34 @@ test('Returns an array', t => {
11
11
} ) ;
12
12
13
13
test ( 'Works with matching groups' , t => {
14
- t . same (
14
+ t . deepEqual (
15
15
replaceString ( 'hey there' , / ( h e y ) / g, x => ( { worked : x } ) ) ,
16
16
[ '' , { worked : 'hey' } , ' there' ]
17
17
) ;
18
18
} ) ;
19
19
20
20
test ( 'Works with strings' , t => {
21
- t . same (
21
+ t . deepEqual (
22
22
replaceString ( 'hey there' , 'hey' , x => ( { worked : x } ) ) ,
23
23
[ '' , { worked : 'hey' } , ' there' ]
24
24
) ;
25
25
} ) ;
26
26
27
27
test ( 'Works with arrays' , t => {
28
28
const input = [ 'hey there' , { value : 'you' } , 'again' ] ;
29
- t . same (
29
+ t . deepEqual (
30
30
replaceString ( input , 'hey' , x => ( { worked : x } ) ) ,
31
31
[ '' , { worked : 'hey' } , ' there' , { value : 'you' } , 'again' ]
32
32
) ;
33
33
} ) ;
34
34
35
35
test ( 'Successfully escapes parens in strings' , t => {
36
- t . same (
36
+ t . deepEqual (
37
37
replaceString ( '(hey) there' , '(hey)' , x => ( { worked : x } ) ) ,
38
38
[ '' , { worked : '(hey)' } , ' there' ]
39
39
) ;
40
40
41
- t . same (
41
+ t . deepEqual (
42
42
replaceString ( 'hey ((y)(you)) there' , '((y)(you))' , x => ( { worked : x } ) ) ,
43
43
[ 'hey ' , { worked : '((y)(you))' } , ' there' ]
44
44
) ;
@@ -53,7 +53,7 @@ test('Can be called consecutively on returned result of previous call', t => {
53
53
{ type : 'url' , value : match }
54
54
) ) ;
55
55
56
- t . same ( reactReplacedTweet , [
56
+ t . deepEqual ( reactReplacedTweet , [
57
57
'Hey @iansinnott, check out this link ' ,
58
58
{ type : 'url' , value : 'https://github.com/iansinnott/' } ,
59
59
' Hope to see you at #reactconf' ,
@@ -64,7 +64,7 @@ test('Can be called consecutively on returned result of previous call', t => {
64
64
{ type : 'mention' , value : match }
65
65
) ) ;
66
66
67
- t . same ( reactReplacedTweet , [
67
+ t . deepEqual ( reactReplacedTweet , [
68
68
'Hey ' ,
69
69
{ type : 'mention' , value : '@iansinnott' } ,
70
70
', check out this link ' ,
@@ -77,7 +77,7 @@ test('Can be called consecutively on returned result of previous call', t => {
77
77
{ type : 'hashtag' , value : match }
78
78
) ) ;
79
79
80
- t . same ( reactReplacedTweet , [
80
+ t . deepEqual ( reactReplacedTweet , [
81
81
'Hey ' ,
82
82
{ type : 'mention' , value : '@iansinnott' } ,
83
83
', check out this link ' ,
0 commit comments