Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions lib/node_modules/@stdlib/stats/incr/nanhmean/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

var tape = require( 'tape' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var abs = require( '@stdlib/math/base/special/abs' );
var EPSILON = require( '@stdlib/constants/float64/eps' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var incrnanhmean = require( './../lib' );


Expand All @@ -49,9 +48,7 @@ tape( 'the initial accumulated value is null', function test( t ) {
tape( 'the accumulator function incrementally computes a harmonic mean', function test( t ) {
var expected;
var actual;
var delta;
var data;
var tol;
var acc;
var sum;
var N;
Expand All @@ -74,13 +71,7 @@ tape( 'the accumulator function incrementally computes a harmonic mean', functio
j += 1;
}
actual = acc( d );
if ( actual === expected ) {
t.strictEqual( actual, expected, 'returns expected result' );
} else {
delta = abs( expected - actual );
tol = EPSILON * expected;
t.strictEqual( delta <= tol, true, 'within tolerance. Expected: '+expected+'. Actual: '+actual+'. Delta: '+delta+'. Tol: '+tol+'.' );
}
t.strictEqual( isAlmostSameValue( actual, expected, 1 ), true, 'returns expected value' );
}
t.end();
});
Expand Down
Loading