Skip to content

Commit 1e5bad1

Browse files
committed
fix: fix array declaration and data length in test.js
1 parent ea3aa39 commit 1e5bad1

File tree

1 file changed

+7
-7
lines changed
  • lib/node_modules/@stdlib/stats/incr/nanmean/test

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ tape( 'the accumulator function incrementally computes an arithmetic mean', func
5555
var d;
5656
var N;
5757

58-
sum = 0;
59-
count = 0;
60-
N = data.length;
6158
data = [ 2.0, 3.0, 2.0, NaN, 4.0, NaN, 3.0, 4.0 ];
59+
N = data.length;
60+
count = 0;
61+
sum = 0;
6262

63-
expected = Array(N).fill(undefined);
64-
actual = Array(N).fill(undefined);
63+
expected = [];
64+
actual = [];
6565

6666
acc = incrnanmean();
6767

@@ -71,8 +71,8 @@ tape( 'the accumulator function incrementally computes an arithmetic mean', func
7171
sum += d;
7272
count += 1;
7373
}
74-
expected[ i ] = ( count === 0 ) ? null : sum / count;
75-
actual[ i ] = acc( d );
74+
expected.push( ( count === 0 ) ? null : sum / count );
75+
actual.push( acc( d ) );
7676
}
7777
t.deepEqual( actual, expected, 'returns expected incremental results' );
7878
t.end();

0 commit comments

Comments
 (0)