Skip to content

feat: add stats/strided/wasm/dmeanors #5832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 30, 2025
Prev Previous commit
Next Next commit
test: fix descriptions
Signed-off-by: Athan <kgryte@gmail.com>
  • Loading branch information
kgryte authored Apr 30, 2025
commit 27e27d787713a27720e3feee2824bf44a081ece2
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ var dmeanors = require( './../lib' );

// TESTS //

tape( 'main export is a function', function test( t ) {
tape( 'main export is an object', function test( t ) {
t.ok( true, __filename );
t.strictEqual( typeof dmeanors.main, 'function', 'main export is a function' );
t.strictEqual( typeof dmeanors, 'object', 'main export is an object' );
t.end();
});

tape( 'the function has an arity of 3', function test( t ) {
tape( 'the `main` method has an arity of 3', function test( t ) {
t.strictEqual( dmeanors.main.length, 3, 'has expected arity' );
t.end();
});

tape( 'the function calculates the arithmetic mean of a strided array', function test( t ) {
tape( 'the `main` method calculates the arithmetic mean of a strided array', function test( t ) {
var x;
var v;

Expand All @@ -58,7 +58,7 @@ tape( 'the function calculates the arithmetic mean of a strided array', function
t.end();
});

tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `NaN`', function test( t ) {
tape( 'if provided an `N` parameter less than or equal to `0`, the `main` method returns `NaN`', function test( t ) {
var x;
var v;

Expand All @@ -73,7 +73,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu
t.end();
});

tape( 'if provided an `N` parameter equal to `1`, the function returns the first element', function test( t ) {
tape( 'if provided an `N` parameter equal to `1`, the `main` method returns the first element', function test( t ) {
var x;
var v;

Expand All @@ -85,7 +85,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
t.end();
});

tape( 'the function supports a `stride` parameter', function test( t ) {
tape( 'the `main` method supports a `stride` parameter', function test( t ) {
var x;
var v;

Expand All @@ -106,7 +106,7 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
t.end();
});

tape( 'the function supports a negative `stride` parameter', function test( t ) {
tape( 'the `main` method supports a negative `stride` parameter', function test( t ) {
var x;
var v;

Expand All @@ -127,7 +127,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
t.end();
});

tape( 'if provided a `stride` parameter equal to `0`, the function returns the first element', function test( t ) {
tape( 'if provided a `stride` parameter equal to `0`, the `main` method returns the first element', function test( t ) {
var x;
var v;

Expand All @@ -139,7 +139,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f
t.end();
});

tape( 'the function supports view offsets', function test( t ) {
tape( 'the `main` method supports view offsets', function test( t ) {
var x0;
var x1;
var v;
Expand Down