Skip to content

Commit 5b31f47

Browse files
committed
solving eslint issue in test.js
1 parent 7456b01 commit 5b31f47

File tree

1 file changed

+20
-9
lines changed
  • lib/node_modules/@stdlib/stats/incr/nanmvariance/test

1 file changed

+20
-9
lines changed

lib/node_modules/@stdlib/stats/incr/nanmvariance/test/test.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,22 @@ tape( 'the accumulator function incrementally computes a moving variance (known
126126

127127
acc = incrnanmvariance( 3, 4.5 );
128128

129-
expected = [ 6.25, 4.25, 2.9166666666666665, 2.9166666666666665, 0.9166666666666666, 0.9166666666666666, 2.9166666666666665, 6.916666666666667, 6.916666666666667, 16.25 ];
129+
expected = [
130+
6.25,
131+
4.25,
132+
2.9166666666666665,
133+
2.9166666666666665,
134+
0.9166666666666666,
135+
0.9166666666666666,
136+
2.9166666666666665,
137+
6.916666666666667,
138+
6.916666666666667,
139+
16.25
140+
];
130141

131-
actual = new Array( N );
142+
actual = [];
132143
for ( i = 0; i < N; i++ ) {
133-
actual[ i ] = acc( data[ i ] );
144+
actual.push( acc( data[ i ] ) );
134145
}
135146
t.deepEqual( actual, expected, 'returns expected incremental results' );
136147

@@ -175,9 +186,9 @@ tape( 'the accumulator function incrementally computes a moving variance (unknow
175186
2.333333333333332 // full window: 8.0, NaN, 10.0 (NaN ignored)
176187
];
177188

178-
actual = new Array( N );
189+
actual = [];
179190
for ( i = 0; i < N; i++ ) {
180-
actual[ i ] = acc( data[ i ] );
191+
actual.push( acc( data[ i ] ) );
181192
// Account for floating-point errors:
182193
if ( abs( actual[i] - expected[i] ) < EPS ) {
183194
actual[ i ] = expected[ i ];
@@ -300,9 +311,9 @@ tape( 'the accumulator function correctly handles NaN values (unknown mean)', fu
300311

301312
acc = incrnanmvariance( 3 );
302313

303-
actual = new Array( N );
314+
actual = [];
304315
for ( i = 0; i < N; i++ ) {
305-
actual[ i ] = acc( data[ i ] );
316+
actual.push( acc( data[ i ] ) );
306317
}
307318
t.deepEqual( actual, expected, 'returns expected incremental results' );
308319
t.equal( acc(), null, 'returns null' );
@@ -328,9 +339,9 @@ tape( 'the accumulator function correctly handles NaN values (known mean)', func
328339

329340
acc = incrnanmvariance( 3, 3.0 );
330341

331-
actual = new Array( N );
342+
actual = [];
332343
for ( i = 0; i < N; i++ ) {
333-
actual[ i ] = acc( data[ i ] );
344+
actual.push( acc( data[ i ] ) );
334345
}
335346
t.deepEqual( actual, expected, 'returns expected incremental results' );
336347
t.equal( acc(), null, 'returns null' );

0 commit comments

Comments
 (0)