You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/iter/replicate-by/test/test.js
-278Lines changed: 0 additions & 278 deletions
Original file line number
Diff line number
Diff line change
@@ -29,37 +29,6 @@ var noop = require( '@stdlib/utils/noop' );
29
29
variterReplicateBy=require('./../lib');
30
30
31
31
32
-
// FUNCTIONS //
33
-
34
-
functioncreateIterator(arr){
35
-
varlen;
36
-
varit;
37
-
vari;
38
-
39
-
len=arr.length;
40
-
i=-1;
41
-
42
-
it={};
43
-
it.next=next;
44
-
45
-
returnit;
46
-
47
-
functionnext(){
48
-
varout;
49
-
i+=1;
50
-
if(i<len){
51
-
out={};
52
-
out.value=arr[i];
53
-
out.done=(i===len-1);
54
-
returnout;
55
-
}
56
-
return{
57
-
'done': true
58
-
};
59
-
}
60
-
}
61
-
62
-
63
32
// TESTS //
64
33
65
34
tape('main export is a function',functiontest(t){
@@ -157,38 +126,6 @@ tape( 'the function returns an iterator protocol-compliant object having a `next
157
126
}
158
127
});
159
128
160
-
tape('the function returns an iterator protocol-compliant object having a `next` method which throws an error if a provided callback function does not return an integer value (value+done)',functiontest(t){
161
-
varvalues;
162
-
vari;
163
-
164
-
values=[
165
-
'5',
166
-
3.14,
167
-
NaN,
168
-
true,
169
-
false,
170
-
null,
171
-
void0,
172
-
[],
173
-
{},
174
-
functionnoop(){}
175
-
];
176
-
for(i=0;i<values.length;i++){
177
-
t.throws(badValue(values[i]),TypeError,'throws an error when a callback returns '+values[i]);
178
-
}
179
-
t.end();
180
-
181
-
functionbadValue(value){
182
-
functionclbk(){
183
-
returnvalue;
184
-
}
185
-
returnfunctionbadValue(){
186
-
varit=iterReplicateBy(createIterator([1]),clbk);
187
-
it.next();
188
-
};
189
-
}
190
-
});
191
-
192
129
tape('the function returns an iterator protocol-compliant object (infinite iterator)',functiontest(t){
193
130
varactual;
194
131
varit;
@@ -623,170 +560,6 @@ tape( 'the function returns an iterator protocol-compliant object which replicat
623
560
}
624
561
});
625
562
626
-
tape('the function returns an iterator protocol-compliant object which replicates each iterated value according to a provided function (value+done; >1)',functiontest(t){
tape('the function returns an iterator protocol-compliant object which replicates each iterated value according to a provided function (value+done; once)',functiontest(t){
tape('the function returns an iterator protocol-compliant object which replicates each iterated value according to a provided function (value+done; none)',functiontest(t){
tape('the function returns an iterator protocol-compliant object which replicates each iterated value according to a provided function (value+done; none)',functiontest(t){
0 commit comments