Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Oct 12, 2023
1 parent 68e140a commit efdd375
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions to-array/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,34 @@ tape( 'main export is a function', function test( t ) {
t.end();
});

tape( 'the function throws an error if not provided an ndarray-like object', function test( t ) {
var values;
var i;

values = [
'5',
5,
NaN,
true,
false,
null,
void 0,
[],
{},
function noop() {}
];
for ( i = 0; i < values.length; i++ ) {
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
}
t.end();

function badValue( value ) {
return function badValue() {
ndarray2array( value );
};
}
});

tape( 'the function returns an empty array if provided an ndarray', function test( t ) {
var out;
var arr;
Expand Down

0 comments on commit efdd375

Please sign in to comment.