@@ -32,119 +32,6 @@ tape( 'main export is a function', function test( t ) {
32
32
t . end ( ) ;
33
33
} ) ;
34
34
35
- tape ( 'the function throws an error if not provided a string as its first argument' , function test ( t ) {
36
- var values ;
37
- var i ;
38
-
39
- values = [
40
- 5 ,
41
- NaN ,
42
- true ,
43
- false ,
44
- null ,
45
- void 0 ,
46
- [ ] ,
47
- { } ,
48
- function noop ( ) { }
49
- ] ;
50
-
51
- for ( i = 0 ; i < values . length ; i ++ ) {
52
- t . throws ( badValue ( values [ i ] ) , TypeError , 'throws an error when provided ' + values [ i ] ) ;
53
- }
54
- t . end ( ) ;
55
-
56
- function badValue ( value ) {
57
- return function badValue ( ) {
58
- replaceAfter ( value , 'foo' , 'e' ) ;
59
- } ;
60
- }
61
- } ) ;
62
-
63
- tape ( 'the function throws an error if not provided a string as its second argument' , function test ( t ) {
64
- var values ;
65
- var i ;
66
-
67
- values = [
68
- 5 ,
69
- NaN ,
70
- true ,
71
- false ,
72
- null ,
73
- void 0 ,
74
- [ ] ,
75
- { } ,
76
- function noop ( ) { }
77
- ] ;
78
-
79
- for ( i = 0 ; i < values . length ; i ++ ) {
80
- t . throws ( badValue ( values [ i ] ) , TypeError , 'throws an error when provided ' + values [ i ] ) ;
81
- }
82
- t . end ( ) ;
83
-
84
- function badValue ( value ) {
85
- return function badValue ( ) {
86
- replaceAfter ( 'beep' , value , 'e' ) ;
87
- } ;
88
- }
89
- } ) ;
90
-
91
- tape ( 'the function throws an error if not provided a string as its third argument' , function test ( t ) {
92
- var values ;
93
- var i ;
94
-
95
- values = [
96
- 5 ,
97
- NaN ,
98
- true ,
99
- false ,
100
- null ,
101
- void 0 ,
102
- [ ] ,
103
- { } ,
104
- function noop ( ) { }
105
- ] ;
106
-
107
- for ( i = 0 ; i < values . length ; i ++ ) {
108
- t . throws ( badValue ( values [ i ] ) , TypeError , 'throws an error when provided ' + values [ i ] ) ;
109
- }
110
- t . end ( ) ;
111
-
112
- function badValue ( value ) {
113
- return function badValue ( ) {
114
- replaceAfter ( 'beep' , 'foo' , value ) ;
115
- } ;
116
- }
117
- } ) ;
118
-
119
- tape ( 'the function throws an error if provided a non-integer value as its fourth argument' , function test ( t ) {
120
- var values ;
121
- var i ;
122
-
123
- values = [
124
- '5' ,
125
- 3.14 ,
126
- NaN ,
127
- true ,
128
- false ,
129
- null ,
130
- void 0 ,
131
- [ ] ,
132
- { } ,
133
- function noop ( ) { }
134
- ] ;
135
-
136
- for ( i = 0 ; i < values . length ; i ++ ) {
137
- t . throws ( badValue ( values [ i ] ) , TypeError , 'throws an error when provided ' + values [ i ] ) ;
138
- }
139
- t . end ( ) ;
140
-
141
- function badValue ( value ) {
142
- return function badValue ( ) {
143
- replaceAfter ( 'beep' , 'foo' , 'e' , value ) ;
144
- } ;
145
- }
146
- } ) ;
147
-
148
35
tape ( 'the function replaces the substring after the first occurrence of a specified search string' , function test ( t ) {
149
36
var replacement ;
150
37
var expected ;
0 commit comments